aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-ior-2.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-07-01 08:37:19 +0000
committerRichard Biener <rguenther@suse.de>2015-07-01 08:37:19 +0000
commitd9ab4649161bc60fc68c9bb36d54b28142a3797a (patch)
treee4a5056a7da5f93f5dbacd47b6f22b61fdf92aad /gcc/testsuite/gcc.dg/fold-ior-2.c
parente79886b1b133e4fd15f1c5c16d3e5a28c1233c33 (diff)
parent00b24710e5527e8b51904824c6e2a7717455c233 (diff)
2015-07-01 Richard Biener <rguenther@suse.de>match-and-simplify
Merge from trunk r225116 through r225225. * match-bitwise.pd: Removed and merged remains into match.pd. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/match-and-simplify@225229 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/fold-ior-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/fold-ior-2.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/fold-ior-2.c b/gcc/testsuite/gcc.dg/fold-ior-2.c
new file mode 100644
index 00000000000..41b372d06fa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-ior-2.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-cddce1" } */
+
+int
+fn1 (int x)
+{
+ return ~x | x;
+}
+
+int
+fn2 (int x)
+{
+ return x | ~x;
+}
+
+unsigned int
+fn3 (unsigned int x)
+{
+ return ~x | x;
+}
+
+unsigned int
+fn4 (unsigned int x)
+{
+ return x | ~x;
+}
+
+int
+fn5 (int x)
+{
+ return ~x | (unsigned) x;
+}
+
+int
+fn6 (int x)
+{
+ return (unsigned) ~x | x;
+}
+
+int
+fn7 (int x)
+{
+ return ~(unsigned) x | x;
+}
+
+/* { dg-final { scan-tree-dump-not "~" "cddce1" } } */
+/* { dg-final { scan-tree-dump-not " \\| " "cddce1" } } */