summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr49039.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/pr49039.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr49039.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr49039.c b/gcc/testsuite/gcc.c-torture/execute/pr49039.c
new file mode 100644
index 000000000..546d114fe
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr49039.c
@@ -0,0 +1,26 @@
+/* PR tree-optimization/49039 */
+extern void abort (void);
+int cnt;
+
+__attribute__((noinline, noclone)) void
+foo (unsigned int x, unsigned int y)
+{
+ unsigned int minv, maxv;
+ if (x == 1 || y == -2U)
+ return;
+ minv = x < y ? x : y;
+ maxv = x > y ? x : y;
+ if (minv == 1)
+ ++cnt;
+ if (maxv == -2U)
+ ++cnt;
+}
+
+int
+main ()
+{
+ foo (-2U, 1);
+ if (cnt != 2)
+ abort ();
+ return 0;
+}