diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr43000.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr43000.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr43000.c b/gcc/testsuite/gcc.dg/torture/pr43000.c new file mode 100644 index 000000000..c11233750 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr43000.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-options "-fwrapv" } */ + +int __attribute__((noinline)) +foo (long i, long j) +{ + if (i >= 1) + if (j > -(long)(((unsigned long)(long)-1)>>1)) + { + long x; + j--; + x = i + j; + if (x >= 0) + return 1; + } + return 0; +} +extern void abort (void); +int main() +{ + if (foo (1, 1) != 1) + abort (); + return 0; +} |