diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/20030903-1.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20030903-1.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030903-1.c b/gcc/testsuite/gcc.c-torture/execute/20030903-1.c new file mode 100644 index 000000000..95dad576f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20030903-1.c @@ -0,0 +1,21 @@ +/* Test that we don't let stmt.c think that the enumeration's values are + the entire set of possibilities. Such an assumption is false for C, + but true for other languages. */ + +enum X { X1 = 1, X2, X3, X4 }; +static volatile enum X test = 0; +static void y(int); + +int main() +{ + switch (test) + { + case X1: y(1); break; + case X2: y(2); break; + case X3: y(3); break; + case X4: y(4); break; + } + return 0; +} + +static void y(int x) { abort (); } |