builtin_ctz_v3.c: New testcase.
authorJesper Nilsson <jesper.nilsson@axis.com>
Thu, 6 Sep 2007 00:17:15 +0000 (00:17 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Thu, 6 Sep 2007 00:17:15 +0000 (00:17 +0000)
* gcc.target/cris/builtin_ctz_v3.c: New testcase.
* gcc.target/cris/builtin_ctz_v8.c: New testcase.

From-SVN: r128168

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

index e6803a8..6f749db 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-06  Jesper Nilsson  <jesper.nilsson@axis.com>
+
+       * gcc.target/cris/builtin_ctz_v3.c: New testcase.
+       * gcc.target/cris/builtin_ctz_v8.c: New testcase.
+
 2007-09-06  Jakub Jelinek  <jakub@redhat.com>
 
        * g++.dg/eh/builtin1.C: New test.
diff --git a/gcc/testsuite/gcc.target/cris/builtin_ctz_v3.c b/gcc/testsuite/gcc.target/cris/builtin_ctz_v3.c
new file mode 100644 (file)
index 0000000..17b14c7
--- /dev/null
@@ -0,0 +1,12 @@
+/* Check that we don't use the swap insn for ctz by checking
+   assembler output.  The swap instruction was implemented in v8.  */
+/* { dg-do compile } */
+/* { dg-skip-if "" { "cris-*-elf" } { "-march*" } { "" } } */
+/* { dg-options "-O2 -march=v3" } */
+/* { dg-final { scan-assembler-not "\[ \t\]swapwbr\[ \t\]" } } */
+
+int
+f (int a)
+{
+       return __builtin_ctz(a);
+}
diff --git a/gcc/testsuite/gcc.target/cris/builtin_ctz_v8.c b/gcc/testsuite/gcc.target/cris/builtin_ctz_v8.c
new file mode 100644 (file)
index 0000000..4ea1d72
--- /dev/null
@@ -0,0 +1,12 @@
+/* Check that we use the swap insn for ctz by checking assembler output.
+   The swap instruction was implemented in v8.  */
+/* { dg-do compile } */
+/* { dg-skip-if "" { "cris-*-elf" } { "-march*" } { "" } } */
+/* { dg-options "-O2 -march=v8" } */
+/* { dg-final { scan-assembler "\[ \t\]swapwbr\[ \t\]" } } */
+
+int
+f (int a)
+{
+       return __builtin_ctz(a);
+}