aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/pr102892-1.c21
-rw-r--r--gcc/testsuite/gcc.dg/pr102892-2.c7
2 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr102892-1.c b/gcc/testsuite/gcc.dg/pr102892-1.c
new file mode 100644
index 0000000..a9302b5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr102892-1.c
@@ -0,0 +1,21 @@
+/* { dg-do link } */
+/* { dg-options "-O3" } */
+/* { dg-additional-sources "pr102892-2.c" } */
+
+static long b[2][1] = {0};
+
+extern void bar(void);
+extern void foo(void);
+
+int
+main ()
+{
+ long c = 0;
+ for (long a; a < 1; ++a)
+ for (; c <= 1; c++) {
+ bar();
+ if (1 == b[c][0])
+ foo();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr102892-2.c b/gcc/testsuite/gcc.dg/pr102892-2.c
new file mode 100644
index 0000000..b39bd6c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr102892-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void
+bar (void)
+{
+}