aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-16 12:21:32 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-16 12:21:32 +0000
commit0a15f066da24c41c88cddf8f6b8e77a1cbf693e4 (patch)
tree24b97089b1cc07696e20f7c452e1298451109f5a
parent1e4b25f4698694d0bd3d6a43bb890a2e352cc92f (diff)
* gcc.target/visium: New directory.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219728 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/visium/bit_shift.c13
-rw-r--r--gcc/testsuite/gcc.target/visium/bit_test.c31
-rw-r--r--gcc/testsuite/gcc.target/visium/block_move.c19
-rw-r--r--gcc/testsuite/gcc.target/visium/cstore_eq.c25
-rw-r--r--gcc/testsuite/gcc.target/visium/cstore_fp.c25
-rw-r--r--gcc/testsuite/gcc.target/visium/cstore_uns.c25
-rw-r--r--gcc/testsuite/gcc.target/visium/long_branch.c27
-rw-r--r--gcc/testsuite/gcc.target/visium/loop_clear.c15
-rw-r--r--gcc/testsuite/gcc.target/visium/visium.exp44
10 files changed, 228 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 29adc51d6d1..ac7c7f296b4 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-16 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/visium: New directory.
+
2015-01-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/61743
diff --git a/gcc/testsuite/gcc.target/visium/bit_shift.c b/gcc/testsuite/gcc.target/visium/bit_shift.c
new file mode 100644
index 00000000000..bf373428de8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/visium/bit_shift.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int bit_shift (long int x)
+{
+ int i, n;
+
+ for (i = n = 0; x && (i < (sizeof(long) * 8)); ++i, x >>= 1)
+ n += (int)(x & 1L);
+ return n;
+}
+
+/* { dg-final { scan-assembler-not "cmp" } } */
diff --git a/gcc/testsuite/gcc.target/visium/bit_test.c b/gcc/testsuite/gcc.target/visium/bit_test.c
new file mode 100644
index 00000000000..2de9208f4b0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/visium/bit_test.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern void bar (void);
+
+void foo1 (unsigned int i)
+{
+ if (i & 4)
+ bar ();
+}
+
+void foo2 (unsigned int i)
+{
+ if (i & 0x80000000)
+ bar ();
+}
+
+void foo3 (unsigned char c)
+{
+ if (c & 4)
+ bar ();
+}
+
+void foo4 (unsigned char c)
+{
+ if (c & 0x80)
+ bar ();
+}
+
+/* { dg-final { scan-assembler-times "lsr.l" 2 } } */
+/* { dg-final { scan-assembler-times "cmp" 2 } } */
diff --git a/gcc/testsuite/gcc.target/visium/block_move.c b/gcc/testsuite/gcc.target/visium/block_move.c
new file mode 100644
index 00000000000..a9e352241b2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/visium/block_move.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mcpu=gr6" } */
+
+extern void abort (void);
+
+#define LEN 256
+
+void foo (void)
+{
+ int dst[LEN], src[LEN];
+ unsigned int i;
+
+ __builtin_memset (src, 0, LEN * sizeof (int));
+ __builtin_memcpy (dst, src, LEN * sizeof (int));
+ if (__builtin_memcmp (dst, src, LEN * sizeof (int)) != 0)
+ abort ();
+}
+
+/* { dg-final { scan-assembler "bmd" } } */
diff --git a/gcc/testsuite/gcc.target/visium/cstore_eq.c b/gcc/testsuite/gcc.target/visium/cstore_eq.c
new file mode 100644
index 00000000000..2bc132a36c2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/visium/cstore_eq.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int foo1 (int i)
+{
+ return (i != 0);
+}
+
+int foo2 (int i)
+{
+ return (i == 0);
+}
+
+int foo3 (int a, int b)
+{
+ return a != b;
+}
+
+int foo4 (int a, int b)
+{
+ return (a == b);
+}
+
+/* { dg-final { scan-assembler-times "adc.l" 2 } } */
+/* { dg-final { scan-assembler-times "subc.l" 2 } } */
diff --git a/gcc/testsuite/gcc.target/visium/cstore_fp.c b/gcc/testsuite/gcc.target/visium/cstore_fp.c
new file mode 100644
index 00000000000..8849d1faba8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/visium/cstore_fp.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-trapping-math" } */
+
+int foo1 (float a, float b)
+{
+ return (a < b);
+}
+
+int foo2 (float a, float b)
+{
+ return (a > b);
+}
+
+int foo3 (float a, float b)
+{
+ return !(a < b);
+}
+
+int foo4 (float a, float b)
+{
+ return !(a > b);
+}
+
+/* { dg-final { scan-assembler-times "adc.l" 2 } } */
+/* { dg-final { scan-assembler-times "subc.l" 2 } } */
diff --git a/gcc/testsuite/gcc.target/visium/cstore_uns.c b/gcc/testsuite/gcc.target/visium/cstore_uns.c
new file mode 100644
index 00000000000..c60f984a13a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/visium/cstore_uns.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int foo1 (unsigned a, unsigned b)
+{
+ return (a < b);
+}
+
+int foo2 (unsigned a, unsigned b)
+{
+ return (a > b);
+}
+
+int foo3 (unsigned a, unsigned b)
+{
+ return (a >= b);
+}
+
+int foo4 (unsigned a, unsigned b)
+{
+ return (a <= b);
+}
+
+/* { dg-final { scan-assembler-times "adc.l" 2 } } */
+/* { dg-final { scan-assembler-times "subc.l" 2 } } */
diff --git a/gcc/testsuite/gcc.target/visium/long_branch.c b/gcc/testsuite/gcc.target/visium/long_branch.c
new file mode 100644
index 00000000000..a53537a1537
--- /dev/null
+++ b/gcc/testsuite/gcc.target/visium/long_branch.c
@@ -0,0 +1,27 @@
+/* { dg-do assemble } */
+
+volatile int k = 0;
+
+#define ONE k++;
+#define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+#define TTH THO THO THO THO THO THO THO THO THO THO THO
+
+void foo (void)
+{
+ start:
+ TTH
+ __asm__ __volatile__ ("" : : : "r28");
+ goto start;
+}
+
+#ifndef __OPTIMIZE__
+void bar (int i)
+{
+ if (i > 0)
+ {
+ TTH
+ }
+}
+#endif
diff --git a/gcc/testsuite/gcc.target/visium/loop_clear.c b/gcc/testsuite/gcc.target/visium/loop_clear.c
new file mode 100644
index 00000000000..740e9d2cd67
--- /dev/null
+++ b/gcc/testsuite/gcc.target/visium/loop_clear.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+extern int a[];
+
+void loop_clear (int i)
+{
+ while (i > 0)
+ a[i--] = 0;
+}
+
+/* { dg-final { scan-assembler-times "cmp" 1 { xfail *-*-* } } } */
+
+/* FIXME: the redundant cmp is not eliminated because the compare-elim pass
+ is run before the dbr pass. It's a regression wrt the cc0 port. */
diff --git a/gcc/testsuite/gcc.target/visium/visium.exp b/gcc/testsuite/gcc.target/visium/visium.exp
new file mode 100644
index 00000000000..5c179a7e26b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/visium/visium.exp
@@ -0,0 +1,44 @@
+# Specific regression driver for Visium.
+# Copyright (C) 2015 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>. */
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't a Visium target.
+if {![istarget visium-*-*] } then {
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish