aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.c-torture/execute/pr59014-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.c-torture/execute/pr59014-2.c')
-rw-r--r--gcc-4.8/gcc/testsuite/gcc.c-torture/execute/pr59014-2.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.c-torture/execute/pr59014-2.c b/gcc-4.8/gcc/testsuite/gcc.c-torture/execute/pr59014-2.c
new file mode 100644
index 000000000..18da0059e
--- /dev/null
+++ b/gcc-4.8/gcc/testsuite/gcc.c-torture/execute/pr59014-2.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/59014 */
+
+__attribute__((noinline, noclone)) long long int
+foo (long long int x, long long int y)
+{
+ if (((int) x | (int) y) != 0)
+ return 6;
+ return x + y;
+}
+
+int
+main ()
+{
+ if (sizeof (long long) == sizeof (int))
+ return 0;
+ int shift_half = sizeof (int) * __CHAR_BIT__ / 2;
+ long long int x = (3LL << shift_half) << shift_half;
+ long long int y = (5LL << shift_half) << shift_half;
+ long long int z = foo (x, y);
+ if (z != ((8LL << shift_half) << shift_half))
+ __builtin_abort ();
+ return 0;
+}