aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20071216-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20071216-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20071216-1.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20071216-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20071216-1.c
new file mode 100644
index 000000000..a337b773a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20071216-1.c
@@ -0,0 +1,38 @@
+/* PR rtl-optimization/34490 */
+
+extern void abort (void);
+
+static int x;
+
+int
+__attribute__((noinline))
+bar (void)
+{
+ return x;
+}
+
+int
+foo (void)
+{
+ long int b = bar ();
+ if ((unsigned long) b < -4095L)
+ return b;
+ if (-b != 38)
+ b = -2;
+ return b + 1;
+}
+
+int
+main (void)
+{
+ x = 26;
+ if (foo () != 26)
+ abort ();
+ x = -39;
+ if (foo () != -1)
+ abort ();
+ x = -38;
+ if (foo () != -37)
+ abort ();
+ return 0;
+}