aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@gcc.gnu.org>2014-10-02 15:40:53 +0200
committerSegher Boessenkool <segher@gcc.gnu.org>2014-10-02 15:40:53 +0200
commit5827c03c811c0dc329be032b542dcb37ac8aa816 (patch)
treea55e335a2fb219f234b4f4bbf3a5968b5fe62505
parentf65eb9e641751e70ee4f0600218866794023ac65 (diff)
downloadgcc-5827c03c811c0dc329be032b542dcb37ac8aa816.zip
gcc-5827c03c811c0dc329be032b542dcb37ac8aa816.tar.gz
gcc-5827c03c811c0dc329be032b542dcb37ac8aa816.tar.bz2
Add file I forgot to add before.
From-SVN: r215802
-rw-r--r--gcc/testsuite/gcc.dg/combine-clobber.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/combine-clobber.c b/gcc/testsuite/gcc.dg/combine-clobber.c
new file mode 100644
index 0000000..bf0d88c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/combine-clobber.c
@@ -0,0 +1,22 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fdump-rtl-combine-all" } */
+
+/* This testcase checks if combine tries to combine sequences where the last
+ insn has a clobber of a reg, and a previous insn sets that reg.
+
+ In this case, we have three insns
+
+ (set flags (compare a b))
+ (set tmp (eq flags 0))
+ (parallel [(set dst (neg tmp))
+ (clobber flags)])
+
+ Previously, combine would not try the three-insn combination because of
+ the set and clobber of flags. Now it does. Test that. */
+
+
+int f(int a, int b) { return -(a == b); }
+
+/* This regexp works for reg parameters as well as mem parameters. */
+/* { dg-final { scan-rtl-dump {neg:SI[^:]*eq:SI[^:]*:SI} "combine" } } */
+/* { dg-final { cleanup-rtl-dump "combine" } } */