aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20030401-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20030401-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20030401-1.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20030401-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20030401-1.c
new file mode 100644
index 000000000..0cc144a85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20030401-1.c
@@ -0,0 +1,27 @@
+/* Testcase for PR fortran/9974. This was a miscompilation of the g77
+ front-end caused by the jump bypassing optimizations not handling
+ instructions inserted on CFG edges. */
+
+extern void abort ();
+
+int bar ()
+{
+ return 1;
+}
+
+void foo (int x)
+{
+ unsigned char error = 0;
+
+ if (! (error = ((x == 0) || bar ())))
+ bar ();
+ if (! error)
+ abort ();
+}
+
+int main()
+{
+ foo (1);
+ return 0;
+}
+