aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr46865-2.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-01-16 22:53:09 +0000
committerJakub Jelinek <jakub@redhat.com>2011-01-16 22:53:09 +0000
commitff3d7866da3431e92bcf6dae905809d16b033707 (patch)
tree29cd778a4a31d601908f13929c48c4738d4ea181 /gcc/testsuite/gcc.target/i386/pr46865-2.c
parent1f4b200fa3ba777d227a527f6255a0f1482ada71 (diff)
Backport from mainline
2010-12-10 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/46865 * rtl.c (rtx_equal_p_cb): For last operand of ASM_OPERANDS and ASM_INPUT if integers are different, call locator_eq. * jump.c (rtx_renumbered_equal_p): Likewise. * gcc.target/i386/pr46865-1.c: New test. * gcc.target/i386/pr46865-2.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_4-branch@168877 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr46865-2.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/pr46865-2.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr46865-2.c b/gcc/testsuite/gcc.target/i386/pr46865-2.c
new file mode 100644
index 00000000000..4a91f7c962b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr46865-2.c
@@ -0,0 +1,32 @@
+/* PR rtl-optimization/46865 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -save-temps" } */
+
+extern unsigned long f;
+
+#define m1(f) \
+ if (f & 1) \
+ asm volatile ("nop /* asmnop */\n"); \
+ else \
+ asm volatile ("nop /* asmnop */\n");
+
+#define m2(f) \
+ if (f & 1) \
+ asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx"); \
+ else \
+ asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
+
+void
+foo (void)
+{
+ m1 (f);
+}
+
+void
+bar (void)
+{
+ m2 (f);
+}
+
+/* { dg-final { scan-assembler-times "asmnop" 2 } } */
+/* { dg-final { cleanup-saved-temps } } */