2015-08-19 Nathan Sidwell <nathan@acm.org>
* lib/target-supports.exp (check_effective_target_freestanding):
nvptx is freestanding.
(check_effective_target_global_constructor): New.
* lib/gcc.exp (gcc_target_compile): Set SIGNAL_SUPPRESS if needed.
* gcc.dg/debug/debug.exp: Skip for nvptx.
* gcc.dg/debug/dwarf2/dwarf2.exp: Likewise.
* gcc.c-torture/execute/981019-1.c: Ptx assembler bug.
* gcc.c-torture/compile/limits-externdecl.c: Likewise.
* gcc.c-torture/compile/pr33855.c: Likewise.
* gcc.c-torture/compile/920723-1.c: Likewise.
* gcc.c-torture/compile/callind.c: Change name to avoid ptxas bug.
* gcc.c-torture/execute/ieee/mul-subnormal-single-1.c: Adjust main
decl to be more normal.
* gcc.c-torture/execute/pr34456.c: Require not freestanding
* gcc.c-torture/execute/vprintf-chk-1.c: Likewise.
* gcc.c-torture/execute/vfprintf-1.c: Likewise.
* gcc.c-torture/execute/gofast.c: Likewise.
* gcc.c-torture/execute/fprintf-1.c: Likewise.
* gcc.c-torture/execute/fprintf-chk-1.c: Likewise.
* gcc.c-torture/execute/vprintf-1.c: Likewise.
* gcc.c-torture/execute/vfprintf-chk-1.c: Likewise.
* gcc.c-torture/execute/builtins/sprintf-chk.x: Require nonlocal goto.
* gcc.c-torture/execute/builtins/snprintf-chk.x: Likewise.
* gcc.c-torture/execute/builtins/memmove-chk.x: Likewise.
* gcc.c-torture/execute/builtins/stpcpy-chk.x: Likewise.
* gcc.c-torture/execute/builtins/memcpy-chk.x: Likewise.
* gcc.c-torture/execute/builtins/mempcpy-chk.x: Likewise.
* gcc.c-torture/execute/builtins/vsnprintf-chk.x: Likewise.
* gcc.c-torture/execute/builtins/memset-chk.x: Likewise.
* gcc.c-torture/execute/builtins/strcpy-chk.x: Likewise.
* gcc.c-torture/execute/builtins/strcat-chk.x: Likewise.
* gcc.c-torture/execute/builtins/stpncpy-chk.x: Likewise.
* gcc.c-torture/execute/builtins/strncpy-chk.x: Likewise.
* gcc.c-torture/execute/builtins/vsprintf-chk.x: Likewise.
* gcc.c-torture/execute/builtins/strncat-chk.x: Likewise.
* gcc.dg/setjmp-1.c: Likewise.
* gcc.dg/cleanup-12.c: Likewise.
* gcc.dg/cleanup-13.c: Likewise.
* gcc.dg/cleanup-5.c: Likewise.
* gcc.dg/constructor-1.c: Require global ctor.
* gcc.dg/fork-instrumentation.c: Require profiling.
* gcc.dg/20030107-1.c: Likewise.
* gcc.dg/20030702-1.c: Likewise.
===================================================================
@@ -580,7 +580,10 @@ proc check_profiling_available { test_wh
# in Section 4 of C99 standard. Effectively, it is a target which supports no
# extra headers or libraries other than what is considered essential.
proc check_effective_target_freestanding { } {
- return 0
+ if { [istarget nvptx-*-*] } {
+ return 1
+ }
+ return 0
}
# Return 1 if target has packed layout of structure members by
@@ -641,6 +644,15 @@ proc check_effective_target_nonlocal_got
if { [istarget nvptx-*-*] } {
return 0
}
+ return 1
+}
+
+# Return 1 if global constructors are supported, 0 otherwise.
+
+proc check_effective_target_global_constructor {} {
+ if { [istarget nvptx-*-*] } {
+ return 0
+ }
return 1
}
===================================================================
@@ -150,6 +150,9 @@ proc gcc_target_compile { source dest ty
if [target_info exists gcc,no_label_values] {
lappend options "additional_flags=-DNO_LABEL_VALUES"
}
+ if [target_info exists gcc,signal_suppress] {
+ lappend options "additional_flags=-DSIGNAL_SUPPRESS"
+ }
# TEST_ALWAYS_FLAGS are flags that should be passed to every
# compilation. They are passed first to allow individual
===================================================================
@@ -19,6 +19,11 @@
# Load support procs.
load_lib gcc-dg.exp
+# Disable on ptx
+if { [istarget nvptx-*-*] } {
+ return
+}
+
# Initialize `dg'.
dg-init
===================================================================
@@ -19,6 +19,11 @@
# Load support procs.
load_lib gcc-dg.exp
+# Disable on ptx
+if { [istarget nvptx-*-*] } {
+ return
+}
+
# If a testcase doesn't have special options, use these.
global DEFAULT_CFLAGS
if ![info exists DEFAULT_CFLAGS] then {
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "requires qsort" { ! freestanding } { "*" } { "" } } */
+
#include <stdlib.h>
int __attribute__ ((noinline)) debug (void) { return 1; }
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "requires io" { ! freestanding } { "*" } { "" } } */
+
#ifndef test
#include <stdio.h>
#include <stdlib.h>
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "ptxas seg faults" { nvptx-*-* } { "-O2" } { "" } } */
+
extern int f2(void);
extern int f3(void);
extern void f1(void);
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "requires io" { ! freestanding } { "*" } { "" } } */
+
#ifndef test
#include <stdio.h>
#include <stdlib.h>
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "requires io" { ! freestanding } { "*" } { "" } } */
+
/* Program to test gcc's usage of the gofast library. */
/* The main guiding themes are to make it trivial to add test cases over time
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "requires io" { ! freestanding } { "*" } { "" } } */
+
#include <stdio.h>
#include <stdlib.h>
===================================================================
@@ -57,7 +57,7 @@ struct
};
int
-main (int argc, char *argv[], char *envp[])
+main ()
{
unsigned int i;
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test3 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test3 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test5 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test4 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test4 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test4 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test3_sub struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test3 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test4 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test3 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test4 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test4 struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test3_sub struct A on epiphany would require
===================================================================
@@ -1,3 +1,9 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_nonlocal_goto] } {
+ return 1
+}
+
if [istarget "epiphany-*-*"] {
# This test assumes the absence of struct padding.
# to make this true for test3 struct A on epiphany would require
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "requires io" { ! freestanding } { "*" } { "" } } */
+
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "requires io" { ! freestanding } { "*" } { "" } } */
+
#ifndef test
#include <stdio.h>
#include <stdlib.h>
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "requires io" { ! freestanding } { "*" } { "" } } */
+
#ifndef test
#include <stdio.h>
#include <stdlib.h>
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "ptxas runs out of memory" { nvptx-*-* } { "*" } { "" } } */
+
/* { dg-require-effective-target int32plus } */
/* Inspired by the test case for PR middle-end/52640. */
===================================================================
@@ -1,3 +1,4 @@
+/* { dg-skip-if "ptxas seg faults" { nvptx-*-* } { "-O1" } { "" } } */
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
/* Used to segfault due to cselim not marking the complex temp var
as GIMPLE reg. */
===================================================================
@@ -1,3 +1,5 @@
+/* { dg-skip-if "ptxas seg faults" { nvptx-*-* } { "-O2" } { "" } } */
+
#if defined(STACK_SIZE) && STACK_SIZE < 65536
# define GITT_SIZE 75
#endif
===================================================================
@@ -1,8 +1,8 @@
-call (foo, a)
+bar (foo, a)
int (**foo) ();
{
- (foo)[1] = call;
+ (foo)[1] = bar;
foo[a] (1);
}
===================================================================
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
+/* { dg-skip-if "" { ! global_constructor } { "*" } { "" } } */
/* The ipa-split pass pulls the body of the if(!x) block
into a separate function to make foo a better inlining
===================================================================
@@ -1,5 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O0 -fprofile-generate" } */
+/* { dg-require-profiling "-fprofile-generate" } */
+
int fork(void);
int
t()
===================================================================
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-options "-O -Wclobbered -Wextra -Wall" } */
+/* { dg-skip-if "" { ! nonlocal_goto } { "*" } { "" } } */
#include <setjmp.h>
===================================================================
@@ -3,6 +3,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -fexceptions" } */
/* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */
+/* { dg-skip-if "" { ! nonlocal_goto } { "*" } { "" } } */
/* Verify unwind info in presence of alloca. */
#include <unwind.h>
===================================================================
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-fprofile-arcs" } */
+/* { dg-require-profiling "-fprofile-generate" } */
extern void bar(void) __attribute__((noreturn));
int foo (void) { bar(); }
===================================================================
@@ -3,6 +3,7 @@
/* { dg-do compile { target fpic } } */
/* { dg-options "-O2 -fpic -fprofile-arcs" } */
/* { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } } */
+/* { dg-require-profiling "-fprofile-generate" } */
int fork (void);
===================================================================
@@ -2,6 +2,7 @@
/* { dg-do run } */
/* { dg-options "-fexceptions" } */
/* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */
+/* { dg-skip-if "" { ! nonlocal_goto } { "*" } { "" } } */
/* Verify DW_OP_* handling in the unwinder. */
#include <unwind.h>
===================================================================
@@ -2,6 +2,7 @@
/* { dg-do run } */
/* { dg-options "-fexceptions" } */
/* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */
+/* { dg-skip-if "" { ! nonlocal_goto } { "*" } { "" } } */
/* Verify that cleanups work with exception handling. */
#include <unwind.h>