* gcc.target/mips/branch-1.c: New test.
authorRichard Sandiford <rsandifo@redhat.com>
Thu, 21 Apr 2005 19:58:20 +0000 (19:58 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 21 Apr 2005 19:58:20 +0000 (19:58 +0000)
From-SVN: r98522

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/branch-1.c [new file with mode: 0644]

index be6cb82758fd08701f99a5a29cc066f88985a3e2..35e33cb6ceaafc7e0603d834b9257abf1bce62bd 100644 (file)
@@ -1,3 +1,7 @@
+2005-04-21  Richard Sandiford  <rsandifo@redhat.com>
+
+       * gcc.target/mips/branch-1.c: New test.
+
 2005-04-21  Richard Henderson  <rth@redhat.com>
 
        * gcc.dg/vect/vect-85.c: Don't xfail on alpha.
diff --git a/gcc/testsuite/gcc.target/mips/branch-1.c b/gcc/testsuite/gcc.target/mips/branch-1.c
new file mode 100644 (file)
index 0000000..6b86dc0
--- /dev/null
@@ -0,0 +1,11 @@
+/* We should implement these "if" statements using an "andi" instruction
+   followed by a branch on zero.  */
+/* { dg-mips-options "-O2 -mno-mips16" } */
+void bar (void);
+void f1 (int x) { if (x & 4) bar (); }
+void f2 (int x) { if ((x >> 2) & 1) bar (); }
+void f3 (unsigned int x) { if (x & 0x10) bar (); }
+void f4 (unsigned int x) { if ((x >> 4) & 1) bar (); }
+/* { dg-final { scan-assembler "\tandi\t.*\tandi\t.*\tandi\t.*\tandi\t" } } */
+/* { dg-final { scan-assembler-not "\tsrl\t" } } */
+/* { dg-final { scan-assembler-not "\tsra\t" } } */