summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp79.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/vrp79.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp79.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp79.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp79.c
new file mode 100644
index 00000000000..88c1bd85821
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp79.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+#ifdef __SIZEOF_INT128__
+typedef unsigned __int128 NT;
+#else
+typedef unsigned long long NT;
+#endif
+
+extern void do_not_go_away ();
+
+void f (NT x, NT y)
+{
+ NT n = 1;
+ n <<= (__CHAR_BIT__ * sizeof (NT) - 1);
+ if (x > n) return;
+ if (y > n) return;
+ NT z = x + y;
+ if (z == 42) do_not_go_away ();
+}
+
+/* { dg-final { scan-tree-dump "do_not_go_away" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */