aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-11-19 12:52:09 +0000
committerRichard Guenther <rguenther@suse.de>2007-11-19 12:52:09 +0000
commitdb9788b21e9a2156c9e4d9b19264d3edaf9def25 (patch)
treedc74ecf418e243c8716a1cec9373a3f013075b5d /gcc/testsuite/gcc.c-torture
parentc6fdde9d946f1a27697ea01b614cb55c44ffbdb1 (diff)
2007-11-19 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34099 * tree-ssa-ccp.c (likely_value): Exclude all but PLUS_EXPR, MINUS_EXPR and POINTER_PLUS_EXPR from handling as UNDEFINED if only one operand is undefined. * gcc.c-torture/execute/pr34099-2.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@130289 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr34099-2.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr34099-2.c b/gcc/testsuite/gcc.c-torture/execute/pr34099-2.c
new file mode 100644
index 00000000000..d335673e30f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr34099-2.c
@@ -0,0 +1,47 @@
+int test1 (int b, int c)
+{
+ char x;
+ if (b)
+ return x / c;
+ else
+ return 1;
+}
+int test2 (int b, int c)
+{
+ int x;
+ if (b)
+ return x * c;
+ else
+ return 1;
+}
+int test3 (int b, int c)
+{
+ int x;
+ if (b)
+ return x % c;
+ else
+ return 1;
+}
+int test4 (int b, int c)
+{
+ char x;
+ if (b)
+ return x == c;
+ else
+ return 1;
+}
+
+extern void abort (void);
+int main()
+{
+ if (test1(1, 1000) != 0)
+ abort ();
+ if (test2(1, 0) != 0)
+ abort ();
+ if (test3(1, 1) != 0)
+ abort ();
+ if (test4(1, 1000) != 0)
+ abort ();
+ return 0;
+}
+