diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr67947.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr67947.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr67947.c b/gcc/testsuite/gcc.dg/torture/pr67947.c new file mode 100644 index 00000000000..5664c48390a --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr67947.c @@ -0,0 +1,30 @@ +/* { dg-additional-options "-O3" } */ + +#include <stdlib.h> + +int a; +int c; +__attribute__((noinline, noclone)) void foo (int x) +{ + if (x == 0) + c++; +} + +int +main (int argc, char* argv[]) +{ + int j, k, b = 0; + if (argc == 0) + b = 1; + for (j = 0; j < 3; j++) + for (k = 0; k < 1; k++) + { + foo (0); + if (b) + for (k = -1; a;) + ; + } + if (c != 3) + abort (); + return 0; +} |