summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/loop-5.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/loop-5.c')
-rw-r--r--gcc/testsuite/gcc.dg/loop-5.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/loop-5.c b/gcc/testsuite/gcc.dg/loop-5.c
new file mode 100644
index 000000000..198823b19
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/loop-5.c
@@ -0,0 +1,16 @@
+/* PR c/16180 */
+/* { dg-options "-O2" } */
+
+extern int b;
+int foo (int a)
+{
+ if (a)
+ {
+ b = 0;
+ for(;;)
+ goto L;
+ }
+ L:
+ for(;;)
+ return 0;
+}