aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr15784-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr15784-4.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr15784-4.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr15784-4.c b/gcc/testsuite/gcc.dg/pr15784-4.c
new file mode 100644
index 00000000000..021b6375efc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr15784-4.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+int a (int x) {
+ return ~x + 1; /* -x */
+}
+
+int b (int x) {
+ return -x -1; /* ~x */
+}
+
+/* { dg-final { scan-tree-dump "~x;" "optimized" } } */
+/* { dg-final { scan-tree-dump "-x;" "optimized" } } */