From: Bernd Schmidt Date: Mon, 10 Nov 2014 16:31:10 +0000 (+0000) Subject: ptx testsuite fix for return addresses. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02ff56e68a381d449723b6d4c19189a08bb66484;p=gcc.git ptx testsuite fix for return addresses. * lib/target-supports.exp (check_effective_target_return_address): New function. * gcc.c-torture/execute/20010122-1.c: Require return_address. * gcc.c-torture/execute/20030323-1.c: Likewise. * gcc.c-torture/execute/20030811-1.c: Likewise. * gcc.c-torture/execute/eeprof-1.c: Likewise. * gcc.c-torture/execute/frame-address.c: Likewise. * gcc.c-torture/execute/pr17377.c: Likewise. From-SVN: r217301 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2da1b6f99e9..3af1a43c8f2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,14 @@ 2014-11-10 Bernd Schmidt + * lib/target-supports.exp (check_effective_target_return_address): + New function. + * gcc.c-torture/execute/20010122-1.c: Require return_address. + * gcc.c-torture/execute/20030323-1.c: Likewise. + * gcc.c-torture/execute/20030811-1.c: Likewise. + * gcc.c-torture/execute/eeprof-1.c: Likewise. + * gcc.c-torture/execute/frame-address.c: Likewise. + * gcc.c-torture/execute/pr17377.c: Likewise. + * gcc.c-torture/compile/920625-2.c: Add return type to freeReturnStruct. * gcc.c-torture/execute/20091229-1.c: Declare main properly. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr35468.c b/gcc/testsuite/gcc.c-torture/compile/pr35468.c index 16d064b6222..0fa017fc738 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr35468.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr35468.c @@ -1,4 +1,5 @@ /* PR tree-optimization/35468 */ +/* { dg-require-effective-target no_const_addr_space } */ void foo (void) diff --git a/gcc/testsuite/gcc.c-torture/execute/20010122-1.c b/gcc/testsuite/gcc.c-torture/execute/20010122-1.c index 14269fa7f0e..528cef7139d 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20010122-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20010122-1.c @@ -1,4 +1,5 @@ /* { dg-skip-if "requires frame pointers" { *-*-* } "-fomit-frame-pointer" "" } */ +/* { dg-require-effective-target return_address } */ extern void exit (int); extern void abort (void); diff --git a/gcc/testsuite/gcc.c-torture/execute/20030323-1.c b/gcc/testsuite/gcc.c-torture/execute/20030323-1.c index 35e2bd18112..bace9a27722 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20030323-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20030323-1.c @@ -1,4 +1,5 @@ /* PR opt/10116 */ +/* { dg-require-effective-target return_address } */ /* Removed tablejump while label still in use; this is really a link test. */ void *NSReturnAddress(int offset) diff --git a/gcc/testsuite/gcc.c-torture/execute/20030811-1.c b/gcc/testsuite/gcc.c-torture/execute/20030811-1.c index 2ac59c03af2..29cfa1591e0 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20030811-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20030811-1.c @@ -1,4 +1,5 @@ /* Origin: PR target/11535 from H. J. Lu */ +/* { dg-require-effective-target return_address } */ void vararg (int i, ...) { diff --git a/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c b/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c index 96dab9a33e1..c2a9ff65f18 100644 --- a/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target return_address } */ /* { dg-options "-finstrument-functions" } */ /* { dg-xfail-if "" { powerpc-ibm-aix* } "*" "" } */ diff --git a/gcc/testsuite/gcc.c-torture/execute/frame-address.c b/gcc/testsuite/gcc.c-torture/execute/frame-address.c index 109c2b229c8..e453f884359 100644 --- a/gcc/testsuite/gcc.c-torture/execute/frame-address.c +++ b/gcc/testsuite/gcc.c-torture/execute/frame-address.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target return_address } */ int check_fa_work (const char *, const char *) __attribute__((noinline)); int check_fa_mid (const char *) __attribute__((noinline)); int check_fa (char *) __attribute__((noinline)); diff --git a/gcc/testsuite/gcc.c-torture/execute/pr17377.c b/gcc/testsuite/gcc.c-torture/execute/pr17377.c index 87d23c5cc1b..11094d1bea5 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr17377.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr17377.c @@ -1,6 +1,7 @@ /* PR target/17377 Bug in code emitted by "return" pattern on CRIS: missing pop of forced return address on stack. */ +/* { dg-require-effective-target return_address } */ int calls = 0; void *f (int) __attribute__ ((__noinline__)); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 123f074040d..a31d050b436 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -632,6 +632,16 @@ proc check_effective_target_label_values {} { }] } +# Return 1 if builtin_return_address and builtin_frame_address are +# supported, 0 otherwise. + +proc check_effective_target_return_address {} { + if { [istarget nvptx-*-*] } { + return 0 + } + return 1 +} + # Return 1 if the assembler does not verify function types against # calls, 0 otherwise. Such verification will typically show up problems # with K&R C function declarations.