aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog17
-rw-r--r--gcc/testsuite/g++.dg/opt/devirt2.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/pragma3.C3
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20101011-1.c4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x5
-rw-r--r--gcc/testsuite/gcc.dg/20020312-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/builtin-apply2.c2
-rw-r--r--gcc/testsuite/gcc.dg/pragma-pack-3.c3
-rw-r--r--gcc/testsuite/gcc.dg/stack-usage-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tls/thr-cse-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c11
-rw-r--r--gcc/testsuite/gcc.dg/weak/typeof-2.c3
-rw-r--r--gcc/testsuite/gcc.target/epiphany/epiphany.exp41
-rw-r--r--gcc/testsuite/gcc.target/epiphany/fmadd-1.c17
-rw-r--r--gcc/testsuite/gcc.target/epiphany/fmsub-1.c17
-rw-r--r--gcc/testsuite/gcc.target/epiphany/interrupt.c14
16 files changed, 143 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 634b218..8091789 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,20 @@
+2011-11-05 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * gcc.c-torture/execute/ieee/mul-subnormal-single-1.x:
+ Disable test on Epiphany.
+ * gcc.c-torture/execute/20101011-1.c: Disable test on Epiphany.
+ * gcc.dg/stack-usage-1.c [__epiphany__] (SIZE): Define.
+ * gcc.dg/pragma-pack-3.c: Disable test on Epiphany.
+ * g++.dg/parse/pragma3.C: Likewise.
+ * stackalign/builtin-apply-2.c (STACK_ARGUMENTS_SIZE): Define.
+ (bar): Use it.
+ * gcc.dg/weak/typeof-2.c [epiphany-*-*]: Add option -mshort-calls.
+ * gcc.dg/tls/thr-cse-1.c: Likewise.
+ * g++.dg/opt/devirt2.C: Likewise.
+ * gcc.dg/20020312-2.c [epiphany-*-*] (PIC_REG): Define.
+ * gcc.dg/builtin-apply2.c [__epiphany__]: (STACK_ARGUMENTS_SIZE): 20.
+ * gcc.target/epiphany: New directory.
+
2011-11-05 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/quad_2.f90: New.
diff --git a/gcc/testsuite/g++.dg/opt/devirt2.C b/gcc/testsuite/g++.dg/opt/devirt2.C
index b068f4d..1198abd 100644
--- a/gcc/testsuite/g++.dg/opt/devirt2.C
+++ b/gcc/testsuite/g++.dg/opt/devirt2.C
@@ -1,5 +1,8 @@
// { dg-do compile }
// { dg-options "-O2" }
+/* Using -mshort-calls avoids loading the function addresses in
+ registers and thus getting the counts wrong. */
+// { dg-additional-options "-mshort-calls" {target epiphany-*-*} }
// { dg-final { scan-assembler-times "xyzzy" 2 { target { ! { alpha*-*-* hppa*-*-* ia64*-*-hpux* sparc*-*-* } } } } }
// The IA64 and HPPA compilers generate external declarations in addition
// to the call so those scans need to be more specific.
diff --git a/gcc/testsuite/g++.dg/parse/pragma3.C b/gcc/testsuite/g++.dg/parse/pragma3.C
index 36d7a8c..57793b3 100644
--- a/gcc/testsuite/g++.dg/parse/pragma3.C
+++ b/gcc/testsuite/g++.dg/parse/pragma3.C
@@ -1,5 +1,6 @@
// PR c++/25294
-// { dg-do run }
+// Epiphany makes struct S 8-byte aligned.
+// { dg-do run { target { ! epiphany-*-* } } }
extern "C" void abort (void);
diff --git a/gcc/testsuite/gcc.c-torture/execute/20101011-1.c b/gcc/testsuite/gcc.c-torture/execute/20101011-1.c
index 156fd7b..fcf8c07 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20101011-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20101011-1.c
@@ -28,6 +28,10 @@
/* Not all Linux kernels deal correctly the breakpoints generated by
MIPS16 divisions by zero. They show up as a SIGTRAP instead. */
# define DO_TEST 0
+#elif defined (__epiphany__)
+ /* Epiphany does not have hardware division, and the software implementation
+ has truly undefined behaviour for division by 0. */
+# define DO_TEST 0
#else
# define DO_TEST 1
#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x
index 4185265..d090cbf 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x
@@ -1,3 +1,8 @@
+if [istarget "epiphany-*-*"] {
+ # The Epiphany single-precision floating point format does not
+ # support subnormals.
+ return 1
+}
if [istarget "mips-sgi-irix6*"] {
# IRIX 6 sets the MIPS IV flush to zero bit by default, so this test
# isn't expected to work for n32 and n64 on MIPS IV targets.
diff --git a/gcc/testsuite/gcc.dg/20020312-2.c b/gcc/testsuite/gcc.dg/20020312-2.c
index 0b3178f..6e568ed 100644
--- a/gcc/testsuite/gcc.dg/20020312-2.c
+++ b/gcc/testsuite/gcc.dg/20020312-2.c
@@ -20,6 +20,8 @@ extern void abort (void);
/* No pic register. */
#elif defined(__cris__)
# define PIC_REG "0"
+#elif defined(__epiphany__)
+#define PIC_REG "r28"
#elif defined(__fr30__)
/* No pic register. */
#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__)
diff --git a/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc/testsuite/gcc.dg/builtin-apply2.c
index 047a1e8..c5b841a 100644
--- a/gcc/testsuite/gcc.dg/builtin-apply2.c
+++ b/gcc/testsuite/gcc.dg/builtin-apply2.c
@@ -12,7 +12,7 @@
#define INTEGER_ARG 5
-#ifdef __ARM_PCS
+#if defined(__ARM_PCS) || defined(__epiphany__)
/* For Base AAPCS, NAME is passed in r0. D is passed in r2 and r3.
E, F and G are passed on stack. So the size of the stack argument
data is 20. */
diff --git a/gcc/testsuite/gcc.dg/pragma-pack-3.c b/gcc/testsuite/gcc.dg/pragma-pack-3.c
index e276bd0..d384314 100644
--- a/gcc/testsuite/gcc.dg/pragma-pack-3.c
+++ b/gcc/testsuite/gcc.dg/pragma-pack-3.c
@@ -1,6 +1,7 @@
/* PR c++/25294 */
/* { dg-options "-std=gnu99" } */
-/* { dg-do run } */
+/* Epiphany makes struct S 8-byte aligned. */
+/* { dg-do run { target { ! epiphany-*-* } } } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c
index f55168e..77dd038 100644
--- a/gcc/testsuite/gcc.dg/stack-usage-1.c
+++ b/gcc/testsuite/gcc.dg/stack-usage-1.c
@@ -52,6 +52,8 @@
# define SIZE 160 /* 256 - 96 bytes for register save area */
#elif defined (__SPU__)
# define SIZE 224
+#elif defined (__epiphany__)
+# define SIZE (256 - __EPIPHANY_STACK_OFFSET__)
#else
# define SIZE 256
#endif
diff --git a/gcc/testsuite/gcc.dg/tls/thr-cse-1.c b/gcc/testsuite/gcc.dg/tls/thr-cse-1.c
index 7542350..87fdc64 100644
--- a/gcc/testsuite/gcc.dg/tls/thr-cse-1.c
+++ b/gcc/testsuite/gcc.dg/tls/thr-cse-1.c
@@ -1,5 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-O1" } */
+/* Using -mshort-calls avoids loading the function addresses in
+ registers and thus getting the counts wrong. */
+/* { dg-additional-options "-mshort-calls" { target epiphany-*-* } } */
/* { dg-require-effective-target tls_emulated } */
/* Test that we only get one call to emutls_get_address when CSE is
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
index a1ba20f..89c71a9 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
@@ -9,6 +9,15 @@
#define INTEGER_ARG 5
+#if defined(__ARM_PCS) || defined(__epiphany__)
+/* For Base AAPCS, NAME is passed in r0. D is passed in r2 and r3.
+ E, F and G are passed on stack. So the size of the stack argument
+ data is 20. */
+#define STACK_ARGUMENTS_SIZE 20
+#else
+#define STACK_ARGUMENTS_SIZE 64
+#endif
+
extern void abort(void);
void foo(char *name, double d, double e, double f, int g)
@@ -19,7 +28,7 @@ void foo(char *name, double d, double e, double f, int g)
void bar(char *name, ...)
{
- __builtin_apply(foo, __builtin_apply_args(), 64);
+ __builtin_apply(foo, __builtin_apply_args(), STACK_ARGUMENTS_SIZE);
}
int main(void)
diff --git a/gcc/testsuite/gcc.dg/weak/typeof-2.c b/gcc/testsuite/gcc.dg/weak/typeof-2.c
index 63f427f..d13235f 100644
--- a/gcc/testsuite/gcc.dg/weak/typeof-2.c
+++ b/gcc/testsuite/gcc.dg/weak/typeof-2.c
@@ -5,6 +5,9 @@
/* { dg-require-weak "" } */
/* { dg-require-alias "" } */
/* { dg-options "-O2" } */
+/* Using -mshort-calls avoids loading the function addresses in
+ registers and thus getting the counts wrong. */
+/* { dg-additional-options "-mshort-calls" { target epiphany-*-* } } */
extern int foo1 (int x) __asm ("baz1");
int bar1 (int x) { return x; }
diff --git a/gcc/testsuite/gcc.target/epiphany/epiphany.exp b/gcc/testsuite/gcc.target/epiphany/epiphany.exp
new file mode 100644
index 0000000..dc9fecc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/epiphany/epiphany.exp
@@ -0,0 +1,41 @@
+# Copyright (C) 2007, 2011 Free Software Foundation, Inc.
+
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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 an epiphany target.
+if ![istarget epiphany*-*-*] 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/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.target/epiphany/fmadd-1.c b/gcc/testsuite/gcc.target/epiphany/fmadd-1.c
new file mode 100644
index 0000000..868d5bd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/epiphany/fmadd-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "fmadd\[ \ta-zA-Z0-9\]*," 2 } } */
+
+#include <epiphany_intrinsics.h>
+
+float
+f1 (float a, float b, float c)
+{
+ return __builtin_epiphany_fmadd (a, b, c);
+}
+
+float
+f2 (float a, float b, float c)
+{
+ return a + b * c;
+}
diff --git a/gcc/testsuite/gcc.target/epiphany/fmsub-1.c b/gcc/testsuite/gcc.target/epiphany/fmsub-1.c
new file mode 100644
index 0000000..ff7fefa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/epiphany/fmsub-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "fmsub\[ \ta-zA-Z0-9\]*," 2 } } */
+
+#include <epiphany_intrinsics.h>
+
+float
+f1 (float a, float b, float c)
+{
+ return __builtin_epiphany_fmsub (a, b, c);
+}
+
+float
+f2 (float a, float b, float c)
+{
+ return a - b * c;
+}
diff --git a/gcc/testsuite/gcc.target/epiphany/interrupt.c b/gcc/testsuite/gcc.target/epiphany/interrupt.c
new file mode 100644
index 0000000..a44c79e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/epiphany/interrupt.c
@@ -0,0 +1,14 @@
+void __attribute__((interrupt("dma0")))
+f (void)
+{
+}
+
+void __attribute__((interrupt("Vss")))
+g (void)
+{ /* { dg-warning "is not \"reset\"" } */
+}
+
+void __attribute__((interrupt(42)))
+h (void)
+{ /* { dg-warning "is not a string constant" } */
+}