diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr120736.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr120736.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr120736.c b/gcc/testsuite/gcc.dg/torture/pr120736.c new file mode 100644 index 0000000..84f808a --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr120736.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-additional-options "-fsigned-char -fno-strict-aliasing -fwrapv" } */ + +unsigned char aa (unsigned char ab, int o) { return ab > o ? ab : 0; } +int p; +int s; +static unsigned char q = 255; +int r; +int *v = &s; +int main() { + p = v != 0; + for (; r < 8; ++r) { + if (s) + break; + s = aa(p * q++, 6) <= 0; + } + if (q != 1) + __builtin_abort (); + __builtin_exit (0); +} + |