diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/infinite-loop.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/infinite-loop.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/infinite-loop.c b/gcc/testsuite/gcc.dg/infinite-loop.c new file mode 100644 index 0000000..25037a2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/infinite-loop.c @@ -0,0 +1,26 @@ +/* { dg-do link } */ +/* { dg-options "-O2" } */ +void link_error (void); + +void __attribute__ ((noinline,noipa)) +foo(int a) +{ + int b = 0; + + while (1) + { + if (!a) + break; + b = 1; + } + + if (b != 0) + link_error (); +} + +int +main() +{ + foo (0); +} + |