diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/enum-3.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/enum-3.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/enum-3.c b/gcc/testsuite/gcc.c-torture/execute/enum-3.c new file mode 100644 index 0000000..f57bc7f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/enum-3.c @@ -0,0 +1,24 @@ +/* The composite type of int and an enum compatible with int might be + either of the two types, but it isn't an unsigned type. */ +/* Origin: Joseph Myers <jsm@polyomino.org.uk> */ + +#include <limits.h> + +#include <stdio.h> + +extern void abort (void); +extern void exit (int); + +enum e { a = INT_MIN }; + +int *p; +enum e *q; +int +main (void) +{ + enum e x = a; + q = &x; + if (*(1 ? q : p) > 0) + abort (); + exit (0); +} |