builtin_bswap_v3.c: New testcase.
authorJesper Nilsson <jesper.nilsson@axis.com>
Mon, 3 Sep 2007 13:41:43 +0000 (13:41 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Mon, 3 Sep 2007 13:41:43 +0000 (13:41 +0000)
* gcc.target/cris/builtin_bswap_v3.c: New testcase.
* gcc.target/cris/builtin_bswap_v8.c: New testcase.

From-SVN: r128044

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/cris/builtin_bswap_v3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/builtin_bswap_v8.c [new file with mode: 0644]

index e8c88bc1e1791bc216b032048e4ba021e8bb9c7e..66a28e9bdfdef3cbc49694ae0a695617b0964f53 100644 (file)
@@ -1,5 +1,8 @@
 2007-09-03  Jesper Nilsson  <jesper.nilsson@axis.com>
 
+       * gcc.target/cris/builtin_bswap_v3.c: New testcase.
+       * gcc.target/cris/builtin_bswap_v8.c: New testcase.
+
        * gcc.dg/torture/cris-asm-mof-1.c: Skip if -march defined.
 
 2007-09-02  David Daney  <ddaney@avtrex.com>
diff --git a/gcc/testsuite/gcc.target/cris/builtin_bswap_v3.c b/gcc/testsuite/gcc.target/cris/builtin_bswap_v3.c
new file mode 100644 (file)
index 0000000..86dc938
--- /dev/null
@@ -0,0 +1,12 @@
+/* Check that we don't use the swap insn for bswap by checking assembler 
+   output.  The swap instruction was added in v8.  */
+/* { dg-do compile } */
+/* { dg-skip-if "" { "cris-*-elf" } { "-march*" } { "" } } */
+/* { dg-options "-O2 -march=v3" } */
+/* { dg-final { scan-assembler-not "\[ \t\]swapwb\[ \t\]" } } */
+
+int
+f (int a)
+{
+       return __builtin_bswap32(a);
+}
diff --git a/gcc/testsuite/gcc.target/cris/builtin_bswap_v8.c b/gcc/testsuite/gcc.target/cris/builtin_bswap_v8.c
new file mode 100644 (file)
index 0000000..408f089
--- /dev/null
@@ -0,0 +1,12 @@
+/* Check that we use the swap insn for bswap by checking assembler
+   output.  The swap instruction was added in v8.  */
+/* { dg-do compile } */
+/* { dg-skip-if "" { "cris-*-elf" } { "-march*" } { "" } } */
+/* { dg-options "-O2 -march=v8" } */
+/* { dg-final { scan-assembler "\[ \t\]swapwb\[ \t\]" } } */
+
+int
+f (int a)
+{
+       return __builtin_bswap32(a);
+}