summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-ior-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/fold-ior-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/fold-ior-3.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/fold-ior-3.c b/gcc/testsuite/gcc.dg/fold-ior-3.c
new file mode 100644
index 00000000000..ed89ff9188c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-ior-3.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-cddce1" } */
+
+int
+fn1 (_Bool a)
+{
+ return ((int) a) | ((int) ~a);
+}
+
+int
+fn2 (unsigned char a)
+{
+ return ((int) a) | ((int) ~a);
+}
+
+int
+fn3 (unsigned short a)
+{
+ return ((int) a) | ((int) ~a);
+}
+
+int
+fn4 (signed char a)
+{
+ return ((int) a) | ((int) ~a);
+}
+
+int
+fn5 (signed short a)
+{
+ return ((int) a) | ((int) ~a);
+}
+
+/* { dg-final { scan-tree-dump-not "~" "cddce1" } } */
+/* { dg-final { scan-tree-dump-not " \\| " "cddce1" } } */