builtin_clz_v0.c: New testcase.
authorJesper Nilsson <jesper.nilsson@axis.com>
Mon, 3 Sep 2007 00:45:11 +0000 (00:45 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Mon, 3 Sep 2007 00:45:11 +0000 (00:45 +0000)
* gcc.target/cris/builtin_clz_v0.c: New testcase.
* gcc.target/cris/builtin_clz_v3.c: New testcase.

From-SVN: r128033

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

index 63b0967737565a598ff40ce0c04d553e0c5286e7..eb93d33e5acd4c488cf3b2fd9ebd1ebfc303503a 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-03  Jesper Nilsson  <jesper.nilsson@axis.com>
+
+       * gcc.target/cris/builtin_clz_v0.c: New testcase.
+       * gcc.target/cris/builtin_clz_v3.c: New testcase.
+
 2007-09-02  Tobias Schlüuter  <tobi@gcc.gnu.org>
 
        * gfortran.dg/substr_6.f90: New test.
diff --git a/gcc/testsuite/gcc.target/cris/builtin_clz_v0.c b/gcc/testsuite/gcc.target/cris/builtin_clz_v0.c
new file mode 100644 (file)
index 0000000..d848a75
--- /dev/null
@@ -0,0 +1,12 @@
+/* Check that we don't use the lz insn for clz by checking assembler output.
+   The lz insn was implemented in CRIS v3 (ETRAX 4).  */
+/* { dg-do compile } */
+/* { dg-skip-if "" { "cris-*-elf" } { "-march*" } { "" } } */
+/* { dg-options "-O2 -march=v0" } */
+/* { dg-final { scan-assembler-not "\[ \t\]lz\[ \t\]" } } */
+
+int
+f (int a)
+{
+       return __builtin_clz(a);
+}
diff --git a/gcc/testsuite/gcc.target/cris/builtin_clz_v3.c b/gcc/testsuite/gcc.target/cris/builtin_clz_v3.c
new file mode 100644 (file)
index 0000000..aa97cb9
--- /dev/null
@@ -0,0 +1,12 @@
+/* Check that we use the lz insn for clz by checking assembler output.
+   The lz insn was implemented in CRIS v3 (ETRAX 4).  */
+/* { dg-do compile } */
+/* { dg-skip-if "" { "cris-*-elf" } { "-march*" } { "" } } */
+/* { dg-options "-O2 -march=v8" } */
+/* { dg-final { scan-assembler "\[ \t\]lz\[ \t\]" } } */
+
+int
+f (int a)
+{
+       return __builtin_clz(a);
+}