summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c
new file mode 100644
index 000000000..1a6e36df8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c
@@ -0,0 +1,29 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+/* Test to check whether global variables are being
+ constant propagated. */
+
+extern void link_error (void);
+
+int G;
+
+void
+foo (int i)
+{
+ if (i > 0)
+ G = 3;
+ else
+ G = 3;
+
+ if (G != 3)
+ link_error ();
+}
+
+int
+main ()
+{
+ foo (0);
+ return 0;
+}
+