diff options
author | sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-19 02:35:29 +0000 |
---|---|---|
committer | sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-19 02:35:29 +0000 |
commit | 7ca4b2b82d26ef69947e5710430fc8d2ed982f5c (patch) | |
tree | 7059e8b231e8fe532f4ce32777fd123fccc81c00 | |
parent | 7438637e3aaf565ef726e8bfacc5c477cf6826a6 (diff) | |
download | gcc-7ca4b2b82d26ef69947e5710430fc8d2ed982f5c.tar.gz |
2007-09-18 Sandra Loosemore <sandra@codesourcery.com>
gcc/testsuite
Restore detection of unsupported TLS.
Revert this patch:
2007-02-10 Richard Henderson <rth@redhat.com>
* lib/target-supports.exp (check_effective_target_tls): Redefine
to mean non-emulated tls.
* gcc.dg/tls/alias-1.c: Remove tls requirement.
* gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c,
gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c,
gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c,
gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise.
And then:
* lib/target-supports.exp (check_effective_target_tls): Use
stronger test for compiler support for TLS.
(check_effective_target_tls_native): New, to test for non-emulated
TLS support.
* g++.dg/gomp/clause-3.C: Use dg-require-effective-target tls_native
instead of dg-require-effective-target tls.
* g++.dg/gomp/copyin-1.C: Likewise.
* g++.dg/gomp/sharing-1.C: Likewise.
* g++.dg/gomp/tls-1.C: Likewise.
* g++.dg/gomp/tls-2.C: Likewise.
* g++.dg/gomp/tls-3.C: Likewise.
* g++.dg/tls/diag-1.C: Likewise.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/tls/diag-3.C: Likewise.
* g++.dg/tls/diag-4.C: Likewise.
* g++.dg/tls/diag-5.C: Likewise.
* g++.dg/tls/init-1.C: Likewise.
* g++.dg/tls/init-2.C: Likewise.
* g++.dg/tls/trivial.C: Likewise.
* gcc.dg/gomp/appendix-a/a.22.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.22.2.c: Likewise.
* gcc.dg/gomp/appendix-a/a.24.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.32.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.33.1.c: Likewise.
* gcc.dg/gomp/clause-1.c: Likewise.
* gcc.dg/gomp/copyin-1.c: Likewise.
* gcc.dg/gomp/sharing-1.c: Likewise.
* gcc.dg/gomp/tls-1.c: Likewise.
* gcc.dg/gomp/tls-2.c: Likewise.
* gcc.dg/tls/alpha-1.c: Likewise.
* gcc.dg/tls/opt-1.c: Likewise.
* gcc.dg/tls/opt-13.c: Likewise.
* gcc.dg/tls/opt-14.c: Likewise.
* gcc.dg/tls/opt-2.c: Likewise.
* gcc.dg/tls/opt-3.c: Likewise.
* gcc.dg/tls/opt-4.c: Likewise.
* gcc.dg/tls/opt-7.c: Likewise.
* gcc.dg/tls/section-1.c: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.4.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.5.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.6.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.32.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.33.1.f90: Likewise.
* gfortran.dg/gomp/crayptr2.f90: Likewise.
* gfortran.dg/gomp/fixed-1.f: Likewise.
* gfortran.dg/gomp/free-1.f90: Likewise.
* gfortran.dg/gomp/omp_threadprivate1.f90: Likewise.
* gfortran.dg/gomp/omp_threadprivate2.f90: Likewise.
* gfortran.dg/gomp/reduction1.f90: Likewise.
* gfortran.dg/gomp/sharing-1.f90: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128595 138bc75d-0d04-0410-961f-82ee72b054a4
67 files changed, 187 insertions, 57 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b0e1b9fa6cd..0f7b6af0e9f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,74 @@ +2007-09-18 Sandra Loosemore <sandra@codesourcery.com> + + Restore detection of unsupported TLS. + + Revert this patch: + 2007-02-10 Richard Henderson <rth@redhat.com> + + * lib/target-supports.exp (check_effective_target_tls): Redefine + to mean non-emulated tls. + * gcc.dg/tls/alias-1.c: Remove tls requirement. + * gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c, + gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c, + gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c, + gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c, + gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c, + gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise. + + And then: + * lib/target-supports.exp (check_effective_target_tls): Use + stronger test for compiler support for TLS. + (check_effective_target_tls_native): New, to test for non-emulated + TLS support. + * g++.dg/gomp/clause-3.C: Use dg-require-effective-target tls_native + instead of dg-require-effective-target tls. + * g++.dg/gomp/copyin-1.C: Likewise. + * g++.dg/gomp/sharing-1.C: Likewise. + * g++.dg/gomp/tls-1.C: Likewise. + * g++.dg/gomp/tls-2.C: Likewise. + * g++.dg/gomp/tls-3.C: Likewise. + * g++.dg/tls/diag-1.C: Likewise. + * g++.dg/tls/diag-2.C: Likewise. + * g++.dg/tls/diag-3.C: Likewise. + * g++.dg/tls/diag-4.C: Likewise. + * g++.dg/tls/diag-5.C: Likewise. + * g++.dg/tls/init-1.C: Likewise. + * g++.dg/tls/init-2.C: Likewise. + * g++.dg/tls/trivial.C: Likewise. + * gcc.dg/gomp/appendix-a/a.22.1.c: Likewise. + * gcc.dg/gomp/appendix-a/a.22.2.c: Likewise. + * gcc.dg/gomp/appendix-a/a.24.1.c: Likewise. + * gcc.dg/gomp/appendix-a/a.32.1.c: Likewise. + * gcc.dg/gomp/appendix-a/a.33.1.c: Likewise. + * gcc.dg/gomp/clause-1.c: Likewise. + * gcc.dg/gomp/copyin-1.c: Likewise. + * gcc.dg/gomp/sharing-1.c: Likewise. + * gcc.dg/gomp/tls-1.c: Likewise. + * gcc.dg/gomp/tls-2.c: Likewise. + * gcc.dg/tls/alpha-1.c: Likewise. + * gcc.dg/tls/opt-1.c: Likewise. + * gcc.dg/tls/opt-13.c: Likewise. + * gcc.dg/tls/opt-14.c: Likewise. + * gcc.dg/tls/opt-2.c: Likewise. + * gcc.dg/tls/opt-3.c: Likewise. + * gcc.dg/tls/opt-4.c: Likewise. + * gcc.dg/tls/opt-7.c: Likewise. + * gcc.dg/tls/section-1.c: Likewise. + * gfortran.dg/gomp/appendix-a/a.22.1.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.22.4.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.22.5.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.22.6.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.32.1.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.33.1.f90: Likewise. + * gfortran.dg/gomp/crayptr2.f90: Likewise. + * gfortran.dg/gomp/fixed-1.f: Likewise. + * gfortran.dg/gomp/free-1.f90: Likewise. + * gfortran.dg/gomp/omp_threadprivate1.f90: Likewise. + * gfortran.dg/gomp/omp_threadprivate2.f90: Likewise. + * gfortran.dg/gomp/reduction1.f90: Likewise. + * gfortran.dg/gomp/sharing-1.f90: Likewise. + 2007-09-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/31119 diff --git a/gcc/testsuite/g++.dg/gomp/clause-3.C b/gcc/testsuite/g++.dg/gomp/clause-3.C index 6b3d410a933..055c189a558 100644 --- a/gcc/testsuite/g++.dg/gomp/clause-3.C +++ b/gcc/testsuite/g++.dg/gomp/clause-3.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_native } #define p parallel diff --git a/gcc/testsuite/g++.dg/gomp/copyin-1.C b/gcc/testsuite/g++.dg/gomp/copyin-1.C index 117f82f8134..f984d10b471 100644 --- a/gcc/testsuite/g++.dg/gomp/copyin-1.C +++ b/gcc/testsuite/g++.dg/gomp/copyin-1.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_native } int i, j; diff --git a/gcc/testsuite/g++.dg/gomp/sharing-1.C b/gcc/testsuite/g++.dg/gomp/sharing-1.C index 83b81809834..25626ff2028 100644 --- a/gcc/testsuite/g++.dg/gomp/sharing-1.C +++ b/gcc/testsuite/g++.dg/gomp/sharing-1.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ int thrglobalvar; #pragma omp threadprivate (thrglobalvar) diff --git a/gcc/testsuite/g++.dg/gomp/tls-1.C b/gcc/testsuite/g++.dg/gomp/tls-1.C index bfe62cb009b..13d2c0d3979 100644 --- a/gcc/testsuite/g++.dg/gomp/tls-1.C +++ b/gcc/testsuite/g++.dg/gomp/tls-1.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_native } int tp1; static int tp2; diff --git a/gcc/testsuite/g++.dg/gomp/tls-2.C b/gcc/testsuite/g++.dg/gomp/tls-2.C index 80275f9081c..26dbc53e5f8 100644 --- a/gcc/testsuite/g++.dg/gomp/tls-2.C +++ b/gcc/testsuite/g++.dg/gomp/tls-2.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ extern char buf[]; #pragma omp threadprivate (buf) /* { dg-error "has incomplete type" } */ diff --git a/gcc/testsuite/g++.dg/gomp/tls-3.C b/gcc/testsuite/g++.dg/gomp/tls-3.C index c42d74c4d57..96baec9453e 100644 --- a/gcc/testsuite/g++.dg/gomp/tls-3.C +++ b/gcc/testsuite/g++.dg/gomp/tls-3.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_native } #define thr threadprivate diff --git a/gcc/testsuite/g++.dg/tls/diag-1.C b/gcc/testsuite/g++.dg/tls/diag-1.C index af538719d24..beeeccb0c0b 100644 --- a/gcc/testsuite/g++.dg/tls/diag-1.C +++ b/gcc/testsuite/g++.dg/tls/diag-1.C @@ -1,5 +1,5 @@ // Valid __thread specifiers. -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_native } __thread int g1; extern __thread int g2; diff --git a/gcc/testsuite/g++.dg/tls/diag-2.C b/gcc/testsuite/g++.dg/tls/diag-2.C index 484b1884515..b48b7d72fdf 100644 --- a/gcc/testsuite/g++.dg/tls/diag-2.C +++ b/gcc/testsuite/g++.dg/tls/diag-2.C @@ -1,5 +1,5 @@ /* Invalid __thread specifiers. */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ __thread extern int g1; /* { dg-error "'__thread' before 'extern'" } */ __thread static int g2; /* { dg-error "'__thread' before 'static'" } */ diff --git a/gcc/testsuite/g++.dg/tls/diag-3.C b/gcc/testsuite/g++.dg/tls/diag-3.C index ea5158b898f..0a05cff186e 100644 --- a/gcc/testsuite/g++.dg/tls/diag-3.C +++ b/gcc/testsuite/g++.dg/tls/diag-3.C @@ -1,5 +1,5 @@ // Report invalid extern and __thread combinations. -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_native } extern int j; // { dg-error "previously declared here" } __thread int j; // { dg-error "follows non-thread-local" } diff --git a/gcc/testsuite/g++.dg/tls/diag-4.C b/gcc/testsuite/g++.dg/tls/diag-4.C index 55e985e9261..6fb9215a668 100644 --- a/gcc/testsuite/g++.dg/tls/diag-4.C +++ b/gcc/testsuite/g++.dg/tls/diag-4.C @@ -1,5 +1,5 @@ /* Invalid __thread specifiers. */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ __thread typedef int g4; /* { dg-error "multiple storage classes" } */ diff --git a/gcc/testsuite/g++.dg/tls/diag-5.C b/gcc/testsuite/g++.dg/tls/diag-5.C index ca92b307428..5859a3d127c 100644 --- a/gcc/testsuite/g++.dg/tls/diag-5.C +++ b/gcc/testsuite/g++.dg/tls/diag-5.C @@ -1,5 +1,5 @@ // PR c++/30536 // Invalid __thread specifiers. -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_native } struct A { __thread register int i; }; // { dg-error "multiple storage classes|storage class specified" } diff --git a/gcc/testsuite/g++.dg/tls/init-1.C b/gcc/testsuite/g++.dg/tls/init-1.C index 97867123a95..91a3afe87e4 100644 --- a/gcc/testsuite/g++.dg/tls/init-1.C +++ b/gcc/testsuite/g++.dg/tls/init-1.C @@ -1,5 +1,5 @@ /* Valid initializations. */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ __thread int i = 42; diff --git a/gcc/testsuite/g++.dg/tls/init-2.C b/gcc/testsuite/g++.dg/tls/init-2.C index c9f646d3a1d..b4407d33a71 100644 --- a/gcc/testsuite/g++.dg/tls/init-2.C +++ b/gcc/testsuite/g++.dg/tls/init-2.C @@ -1,5 +1,5 @@ /* Invalid initializations. */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ extern __thread int i; __thread int *p = &i; /* { dg-error "dynamically initialized" } */ diff --git a/gcc/testsuite/g++.dg/tls/trivial.C b/gcc/testsuite/g++.dg/tls/trivial.C index e2b8f45b845..6c30da72747 100644 --- a/gcc/testsuite/g++.dg/tls/trivial.C +++ b/gcc/testsuite/g++.dg/tls/trivial.C @@ -1,3 +1,3 @@ -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_native } __thread int i; diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.1.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.1.c index e3586838a34..2cc14888c5c 100644 --- a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.1.c +++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ int counter = 0; #pragma omp threadprivate(counter) diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.2.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.2.c index 7a6e901a8c7..171bc2094c5 100644 --- a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.2.c +++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ int increment_counter_2 () diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c index 9d8baa37f23..5662e70c54f 100644 --- a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c +++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ extern int omp_get_num_threads (void); int x, y, t, z[1000]; diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.32.1.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.32.1.c index d2cb316f3cc..89d841c7956 100644 --- a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.32.1.c +++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.32.1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ #include <stdlib.h> float *work; diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.1.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.1.c index 99c06da6a5d..364a71e22a0 100644 --- a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.1.c +++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ #include <stdio.h> float x, y; diff --git a/gcc/testsuite/gcc.dg/gomp/clause-1.c b/gcc/testsuite/gcc.dg/gomp/clause-1.c index ace9738043a..cfab168af91 100644 --- a/gcc/testsuite/gcc.dg/gomp/clause-1.c +++ b/gcc/testsuite/gcc.dg/gomp/clause-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ #define p parallel diff --git a/gcc/testsuite/gcc.dg/gomp/copyin-1.c b/gcc/testsuite/gcc.dg/gomp/copyin-1.c index 117f82f8134..f984d10b471 100644 --- a/gcc/testsuite/gcc.dg/gomp/copyin-1.c +++ b/gcc/testsuite/gcc.dg/gomp/copyin-1.c @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_native } int i, j; diff --git a/gcc/testsuite/gcc.dg/gomp/sharing-1.c b/gcc/testsuite/gcc.dg/gomp/sharing-1.c index 90d389b7292..6b53efe4e4e 100644 --- a/gcc/testsuite/gcc.dg/gomp/sharing-1.c +++ b/gcc/testsuite/gcc.dg/gomp/sharing-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ #include <stdlib.h> diff --git a/gcc/testsuite/gcc.dg/gomp/tls-1.c b/gcc/testsuite/gcc.dg/gomp/tls-1.c index 9dc102e7e61..7a36c2db65e 100644 --- a/gcc/testsuite/gcc.dg/gomp/tls-1.c +++ b/gcc/testsuite/gcc.dg/gomp/tls-1.c @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-require-effective-target tls } +// { dg-require-effective-target tls_native } int tp1; static int tp2; diff --git a/gcc/testsuite/gcc.dg/gomp/tls-2.c b/gcc/testsuite/gcc.dg/gomp/tls-2.c index 80275f9081c..26dbc53e5f8 100644 --- a/gcc/testsuite/gcc.dg/gomp/tls-2.c +++ b/gcc/testsuite/gcc.dg/gomp/tls-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ extern char buf[]; #pragma omp threadprivate (buf) /* { dg-error "has incomplete type" } */ diff --git a/gcc/testsuite/gcc.dg/tls/alias-1.c b/gcc/testsuite/gcc.dg/tls/alias-1.c index 1098190ebd0..28cb47e5041 100644 --- a/gcc/testsuite/gcc.dg/tls/alias-1.c +++ b/gcc/testsuite/gcc.dg/tls/alias-1.c @@ -1,6 +1,7 @@ /* { dg-do link } */ /* { dg-require-alias "" } */ /* { dg-require-visibility "" } */ +/* { dg-require-effective-target tls } */ /* Test that encode_section_info handles the change from externally defined to locally defined (via hidden). Extracted from glibc. */ diff --git a/gcc/testsuite/gcc.dg/tls/alpha-1.c b/gcc/testsuite/gcc.dg/tls/alpha-1.c index 1d15cb1681c..1f0d6eda1d8 100644 --- a/gcc/testsuite/gcc.dg/tls/alpha-1.c +++ b/gcc/testsuite/gcc.dg/tls/alpha-1.c @@ -1,7 +1,7 @@ /* Make sure that we honor initial-exec. */ /* { dg-do compile { target alpha*-*-* } } */ /* { dg-options "" } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ static __thread int xyzzy __attribute__ ((tls_model ("initial-exec"))); int foo(void) { return xyzzy; } diff --git a/gcc/testsuite/gcc.dg/tls/asm-1.c b/gcc/testsuite/gcc.dg/tls/asm-1.c index 476fe7cbb72..b77e550d7bf 100644 --- a/gcc/testsuite/gcc.dg/tls/asm-1.c +++ b/gcc/testsuite/gcc.dg/tls/asm-1.c @@ -1,4 +1,5 @@ /* { dg-options "-Werror" } */ +/* { dg-require-effective-target tls } */ __thread int i; int foo () diff --git a/gcc/testsuite/gcc.dg/tls/debug-1.c b/gcc/testsuite/gcc.dg/tls/debug-1.c index 719f0645771..67d7be69cc5 100644 --- a/gcc/testsuite/gcc.dg/tls/debug-1.c +++ b/gcc/testsuite/gcc.dg/tls/debug-1.c @@ -1,4 +1,5 @@ /* { dg-do assemble } */ /* { dg-options "-g" } */ +/* { dg-require-effective-target tls } */ __thread int i; diff --git a/gcc/testsuite/gcc.dg/tls/diag-1.c b/gcc/testsuite/gcc.dg/tls/diag-1.c index ae4f3d4a3c2..56b570c94a5 100644 --- a/gcc/testsuite/gcc.dg/tls/diag-1.c +++ b/gcc/testsuite/gcc.dg/tls/diag-1.c @@ -1,4 +1,5 @@ /* Valid __thread specifiers. */ +/* { dg-require-effective-target tls } */ __thread int g1; extern __thread int g2; diff --git a/gcc/testsuite/gcc.dg/tls/diag-2.c b/gcc/testsuite/gcc.dg/tls/diag-2.c index 5e7e17bee5a..8276cb3be49 100644 --- a/gcc/testsuite/gcc.dg/tls/diag-2.c +++ b/gcc/testsuite/gcc.dg/tls/diag-2.c @@ -1,4 +1,5 @@ /* Invalid __thread specifiers. */ +/* { dg-require-effective-target tls } */ __thread extern int g1; /* { dg-error "'__thread' before 'extern'" } */ __thread static int g2; /* { dg-error "'__thread' before 'static'" } */ diff --git a/gcc/testsuite/gcc.dg/tls/diag-3.c b/gcc/testsuite/gcc.dg/tls/diag-3.c index f1ce06b70d8..45d89b43722 100644 --- a/gcc/testsuite/gcc.dg/tls/diag-3.c +++ b/gcc/testsuite/gcc.dg/tls/diag-3.c @@ -1,4 +1,5 @@ /* Report invalid extern and __thread combinations. */ +/* { dg-require-effective-target tls } */ extern int j; /* { dg-error "previous declaration" } */ __thread int j; /* { dg-error "follows non-thread-local" } */ diff --git a/gcc/testsuite/gcc.dg/tls/diag-4.c b/gcc/testsuite/gcc.dg/tls/diag-4.c index df3705d04ee..fed2f3accd3 100644 --- a/gcc/testsuite/gcc.dg/tls/diag-4.c +++ b/gcc/testsuite/gcc.dg/tls/diag-4.c @@ -1,5 +1,6 @@ /* Invalid __thread specifiers. As diag-4.c but some cases in different orders. */ +/* { dg-require-effective-target tls } */ __thread typedef int g4; /* { dg-error "'__thread' used with 'typedef'" } */ diff --git a/gcc/testsuite/gcc.dg/tls/diag-5.c b/gcc/testsuite/gcc.dg/tls/diag-5.c index d86046f500c..ac78cb2951d 100644 --- a/gcc/testsuite/gcc.dg/tls/diag-5.c +++ b/gcc/testsuite/gcc.dg/tls/diag-5.c @@ -1,3 +1,4 @@ /* __thread specifiers on empty declarations. */ +/* { dg-require-effective-target tls } */ __thread struct foo; /* { dg-warning "useless '__thread' in empty declaration" } */ diff --git a/gcc/testsuite/gcc.dg/tls/init-1.c b/gcc/testsuite/gcc.dg/tls/init-1.c index 97258643bf2..fa4208dce0c 100644 --- a/gcc/testsuite/gcc.dg/tls/init-1.c +++ b/gcc/testsuite/gcc.dg/tls/init-1.c @@ -1,4 +1,5 @@ /* Invalid initializations. */ +/* { dg-require-effective-target tls } */ extern __thread int i; int *p = &i; /* { dg-error "initializer element is not constant" } */ diff --git a/gcc/testsuite/gcc.dg/tls/nonpic-1.c b/gcc/testsuite/gcc.dg/tls/nonpic-1.c index 0896df60b56..9c592a98556 100644 --- a/gcc/testsuite/gcc.dg/tls/nonpic-1.c +++ b/gcc/testsuite/gcc.dg/tls/nonpic-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -ftls-model=initial-exec" } */ +/* { dg-require-effective-target tls } */ extern __thread long e1; extern __thread int e2; diff --git a/gcc/testsuite/gcc.dg/tls/opt-1.c b/gcc/testsuite/gcc.dg/tls/opt-1.c index f9399e04a88..f96bb676838 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-1.c +++ b/gcc/testsuite/gcc.dg/tls/opt-1.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fPIC" } */ /* { dg-options "-O2 -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ /* { dg-require-effective-target fpic } */ extern __thread int thr; diff --git a/gcc/testsuite/gcc.dg/tls/opt-10.c b/gcc/testsuite/gcc.dg/tls/opt-10.c index 777e585569a..15dc6861042 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-10.c +++ b/gcc/testsuite/gcc.dg/tls/opt-10.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target fpic } */ /* { dg-options "-O3 -fpic" } */ +/* { dg-require-effective-target tls } */ /* The web pass was creating unrecognisable pic_load_dot_plus_four insns on ARM. */ diff --git a/gcc/testsuite/gcc.dg/tls/opt-13.c b/gcc/testsuite/gcc.dg/tls/opt-13.c index 8eea76b68ab..aadfb288f3f 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-13.c +++ b/gcc/testsuite/gcc.dg/tls/opt-13.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ __thread struct { diff --git a/gcc/testsuite/gcc.dg/tls/opt-14.c b/gcc/testsuite/gcc.dg/tls/opt-14.c index 5abeacea7d3..2549c896742 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-14.c +++ b/gcc/testsuite/gcc.dg/tls/opt-14.c @@ -3,7 +3,7 @@ used. */ /* { dg-do assemble } */ /* { dg-options "-O2" } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ struct __res_state { diff --git a/gcc/testsuite/gcc.dg/tls/opt-2.c b/gcc/testsuite/gcc.dg/tls/opt-2.c index b4cabd48347..8038d1c6ffb 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-2.c +++ b/gcc/testsuite/gcc.dg/tls/opt-2.c @@ -5,7 +5,7 @@ /* { dg-do link } */ /* { dg-options "-O2 -ftls-model=initial-exec" } */ /* { dg-options "-O2 -ftls-model=initial-exec -march=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ __thread int thr; diff --git a/gcc/testsuite/gcc.dg/tls/opt-3.c b/gcc/testsuite/gcc.dg/tls/opt-3.c index dd37dbc828a..61f5bdbbaf2 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-3.c +++ b/gcc/testsuite/gcc.dg/tls/opt-3.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fpic" } */ /* { dg-options "-O2 -fpic -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ /* { dg-require-effective-target fpic } */ extern __thread int i, j, k; diff --git a/gcc/testsuite/gcc.dg/tls/opt-4.c b/gcc/testsuite/gcc.dg/tls/opt-4.c index aa59ee7fabf..3d7953b47ef 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-4.c +++ b/gcc/testsuite/gcc.dg/tls/opt-4.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ struct A { diff --git a/gcc/testsuite/gcc.dg/tls/opt-5.c b/gcc/testsuite/gcc.dg/tls/opt-5.c index ee71cad3c02..0ae9f075d7a 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-5.c +++ b/gcc/testsuite/gcc.dg/tls/opt-5.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ +/* { dg-require-effective-target tls } */ /* Sched1 moved {load_tp} pattern between strlen call and the copy of the hard return value to its pseudo. This resulted in a reload abort, since the hard register was not spillable. */ diff --git a/gcc/testsuite/gcc.dg/tls/opt-6.c b/gcc/testsuite/gcc.dg/tls/opt-6.c index de04c1cb3fc..8a01c019c10 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-6.c +++ b/gcc/testsuite/gcc.dg/tls/opt-6.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ +/* { dg-require-effective-target tls } */ extern void abort (void); extern void exit (int); diff --git a/gcc/testsuite/gcc.dg/tls/opt-7.c b/gcc/testsuite/gcc.dg/tls/opt-7.c index 44b900f542a..d3e81f45e1d 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-7.c +++ b/gcc/testsuite/gcc.dg/tls/opt-7.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fPIC" } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ /* { dg-require-effective-target fpic } */ static __thread void *baz [4] __attribute__((tls_model ("initial-exec"))); diff --git a/gcc/testsuite/gcc.dg/tls/opt-8.c b/gcc/testsuite/gcc.dg/tls/opt-8.c index dec0eabcb4c..a7331115352 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-8.c +++ b/gcc/testsuite/gcc.dg/tls/opt-8.c @@ -1,6 +1,7 @@ /* PR 18910 */ /* { dg-do compile } */ /* { dg-options "-O2" } */ +/* { dg-require-effective-target tls } */ static __thread void *foo [2]; void diff --git a/gcc/testsuite/gcc.dg/tls/opt-9.c b/gcc/testsuite/gcc.dg/tls/opt-9.c index 4cc16313b1c..49aa9085fdd 100644 --- a/gcc/testsuite/gcc.dg/tls/opt-9.c +++ b/gcc/testsuite/gcc.dg/tls/opt-9.c @@ -2,6 +2,7 @@ /* { dg-do compile */ /* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -fPIC" } */ +/* { dg-require-effective-target tls } */ struct S { int x[10]; }; extern __thread struct S s; diff --git a/gcc/testsuite/gcc.dg/tls/pic-1.c b/gcc/testsuite/gcc.dg/tls/pic-1.c index f40267c10a3..9108b58aa50 100644 --- a/gcc/testsuite/gcc.dg/tls/pic-1.c +++ b/gcc/testsuite/gcc.dg/tls/pic-1.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -fpic -ftls-model=global-dynamic" } */ +/* { dg-require-effective-target tls } */ extern __thread long e1; extern __thread int e2; diff --git a/gcc/testsuite/gcc.dg/tls/section-1.c b/gcc/testsuite/gcc.dg/tls/section-1.c index 4fc5066b90d..1ca2ffb9070 100644 --- a/gcc/testsuite/gcc.dg/tls/section-1.c +++ b/gcc/testsuite/gcc.dg/tls/section-1.c @@ -1,6 +1,6 @@ /* Verify that we get errors for trying to put TLS data in sections which can't work. */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_native } */ #define A(X) __attribute__((section(X))) diff --git a/gcc/testsuite/gcc.dg/tls/struct-1.c b/gcc/testsuite/gcc.dg/tls/struct-1.c index cf931bf9e62..fbe3e3c102e 100644 --- a/gcc/testsuite/gcc.dg/tls/struct-1.c +++ b/gcc/testsuite/gcc.dg/tls/struct-1.c @@ -3,6 +3,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -fpic" } */ +/* { dg-require-effective-target tls } */ struct S { int s0, s1, s2, s3; diff --git a/gcc/testsuite/gcc.dg/tls/trivial.c b/gcc/testsuite/gcc.dg/tls/trivial.c index 1fd70631f33..96b8e49a665 100644 --- a/gcc/testsuite/gcc.dg/tls/trivial.c +++ b/gcc/testsuite/gcc.dg/tls/trivial.c @@ -1 +1,3 @@ +/* { dg-require-effective-target tls } */ + __thread int i; diff --git a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.1.f90 b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.1.f90 index cc94b140384..96b6abc9187 100644 --- a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.1.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } INTEGER FUNCTION INCREMENT_COUNTER() COMMON/A22_COMMON/COUNTER diff --git a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.4.f90 b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.4.f90 index 2a637580ba7..a272af5c705 100644 --- a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.4.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.4.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } MODULE A22_MODULE COMMON /T/ A diff --git a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.5.f90 b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.5.f90 index 6531d826c57..abd911fa687 100644 --- a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.5.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.5.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } SUBROUTINE A22_5_WRONG() COMMON /T/ A diff --git a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.6.f90 b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.6.f90 index 0a2e6a6836f..1d745932c8f 100644 --- a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.6.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.6.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } SUBROUTINE A22_6_GOOD() COMMON /T/ A diff --git a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90 b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90 index e5b95450d28..87388e3ec9f 100644 --- a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } SUBROUTINE A24(A) INTEGER A diff --git a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.32.1.f90 b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.32.1.f90 index 498a6d324a6..8bf2010a437 100644 --- a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.32.1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.32.1.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } MODULE M REAL, POINTER, SAVE :: WORK(:) diff --git a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.33.1.f90 b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.33.1.f90 index 05145b1715f..a161d5441d5 100644 --- a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.33.1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.33.1.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } SUBROUTINE INIT(A,B) REAL A, B diff --git a/gcc/testsuite/gfortran.dg/gomp/crayptr2.f90 b/gcc/testsuite/gfortran.dg/gomp/crayptr2.f90 index 476d7b9e771..0032080c792 100644 --- a/gcc/testsuite/gfortran.dg/gomp/crayptr2.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/crayptr2.f90 @@ -1,6 +1,6 @@ ! { dg-do compile } ! { dg-options "-fopenmp -fcray-pointer" } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } module crayptr2 integer :: e ! { dg-error "CRAY POINTEE attribute conflicts with THREADPRIVATE" } diff --git a/gcc/testsuite/gfortran.dg/gomp/fixed-1.f b/gcc/testsuite/gfortran.dg/gomp/fixed-1.f index d61f2ba638d..83233567fca 100644 --- a/gcc/testsuite/gfortran.dg/gomp/fixed-1.f +++ b/gcc/testsuite/gfortran.dg/gomp/fixed-1.f @@ -1,6 +1,6 @@ C PR fortran/24493 C { dg-do compile } -C { dg-require-effective-target tls } +C { dg-require-effective-target tls_native } INTEGER I, J, K, L, M C$OMP THREADPRIVATE(I) C SOME COMMENT diff --git a/gcc/testsuite/gfortran.dg/gomp/free-1.f90 b/gcc/testsuite/gfortran.dg/gomp/free-1.f90 index f6f9de4441b..3503389cea0 100644 --- a/gcc/testsuite/gfortran.dg/gomp/free-1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/free-1.f90 @@ -1,4 +1,4 @@ -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } subroutine foo integer, save :: i ! Some comment diff --git a/gcc/testsuite/gfortran.dg/gomp/omp_threadprivate1.f90 b/gcc/testsuite/gfortran.dg/gomp/omp_threadprivate1.f90 index 2ccf93caca5..2380e3bbfac 100644 --- a/gcc/testsuite/gfortran.dg/gomp/omp_threadprivate1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/omp_threadprivate1.f90 @@ -1,4 +1,4 @@ -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } module omp_threadprivate1 common /T/ a end module omp_threadprivate1 diff --git a/gcc/testsuite/gfortran.dg/gomp/omp_threadprivate2.f90 b/gcc/testsuite/gfortran.dg/gomp/omp_threadprivate2.f90 index cd1ab5cd60a..3112afd1bf1 100644 --- a/gcc/testsuite/gfortran.dg/gomp/omp_threadprivate2.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/omp_threadprivate2.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } subroutine bad1 double precision :: d ! { dg-error "isn't SAVEd" } !$omp threadprivate (d) diff --git a/gcc/testsuite/gfortran.dg/gomp/reduction1.f90 b/gcc/testsuite/gfortran.dg/gomp/reduction1.f90 index b6575063c36..108e5dc4155 100644 --- a/gcc/testsuite/gfortran.dg/gomp/reduction1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/reduction1.f90 @@ -1,6 +1,6 @@ ! { dg-do compile } ! { dg-options "-fopenmp -fmax-errors=100" } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } subroutine foo (ia1) integer :: i1, i2, i3 diff --git a/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90 b/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90 index 7a107ffe7cb..89bc6a8e397 100644 --- a/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-require-effective-target tls } +! { dg-require-effective-target tls_native } integer :: thrpriv, thr, i, j, s, g1, g2, m integer, dimension (6) :: p diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 0a74b3d9e79..5a39b8608d2 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -411,7 +411,7 @@ proc check_effective_target_pcc_bitfield_type_matters { } { }] } -# Return 1 if *native* thread local storage (TLS) is supported, 0 otherwise. +# Return 1 if thread local storage (TLS) is supported, 0 otherwise. # # This won't change for different subtargets so cache the result. @@ -422,35 +422,75 @@ proc check_effective_target_tls {} { if [info exists et_tls_saved] { verbose "check_effective_target_tls: using cached result" 2 } else { - set et_tls_saved 1 + set et_tls_saved 0 set src tls[pid].c set asm tls[pid].S verbose "check_effective_target_tls: compiling testfile $src" 2 set f [open $src "w"] - # Compile a small test program. + # Compile a small test program. Make sure that we test accesses + # as well as declarations. + puts $f "__thread int i;\n" + puts $f "int f (void) { return i; }\n" + puts $f "void g (int j) { i = j; }\n" + close $f + + # Test for thread-local data supported by the platform. + set comp_output \ + [${tool}_target_compile $src $asm assembly ""] + file delete $src + if { [string match "" $comp_output] } { + # No error messages, everything is OK. + set et_tls_saved 1 + } + remove-build-file $asm + } + verbose "check_effective_target_tls: returning $et_tls_saved" 2 + return $et_tls_saved +} + +# Return 1 if *native* thread local storage (TLS) is supported, 0 otherwise. +# +# This won't change for different subtargets so cache the result. + +proc check_effective_target_tls_native {} { + global et_tls_native_saved + global tool + + if [info exists et_tls_saved] { + verbose "check_effective_target_tls_native: using cached result" 2 + } else { + set et_tls_native_saved 0 + + set src tls[pid].c + set asm tls[pid].S + verbose "check_effective_target_tls_native: compiling testfile $src" 2 + set f [open $src "w"] + # Compile a small test program. Make sure that we test accesses + # as well as declarations. puts $f "__thread int i;\n" + puts $f "int f (void) { return i; }\n" + puts $f "void g (int j) { i = j; }\n" close $f # Test for thread-local data supported by the platform. set comp_output [${tool}_target_compile $src $asm assembly ""] file delete $src - if { [string match "*not supported*" $comp_output] } { - set et_tls_saved 0 - } else { + if { [string match "" $comp_output] } { + # No error messages, everything is OK. set fd [open $asm r] set text [read $fd] close $fd if { [string match "*emutls*" $text]} { - set et_tls_saved 0 + set et_tls_native_saved 0 } else { - set et_tls_saved 1 + set et_tls_native_saved 1 } } remove-build-file $asm } - verbose "check_effective_target_tls: returning $et_tls_saved" 2 - return $et_tls_saved + verbose "check_effective_target_tls_native: returning $et_tls_native_saved" 2 + return $et_tls_native_saved } # Return 1 if TLS executables can run correctly, 0 otherwise. |