diff options
Diffstat (limited to 'gcc-4.8.1/gcc/testsuite/g++.dg/tls')
33 files changed, 0 insertions, 783 deletions
diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-1.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-1.C deleted file mode 100644 index af538719d..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-1.C +++ /dev/null @@ -1,31 +0,0 @@ -// Valid __thread specifiers. -// { dg-require-effective-target tls } - -__thread int g1; -extern __thread int g2; -static __thread int g3; - -void foo() -{ - extern __thread int l1; - static __thread int l2; -} - -struct A { - static __thread int i; -}; - -__thread int A::i = 42; - -template <typename T> struct B { - static __thread T t; -}; - -template <typename T> -__thread T B<T>::t = 42; - -void bar () -{ - int j = B<int>::t; - int k = B<const int>::t; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-2.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-2.C deleted file mode 100644 index b5d02e7fe..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-2.C +++ /dev/null @@ -1,26 +0,0 @@ -/* 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'" } */ -__thread __thread int g3; /* { dg-error "duplicate '__thread'" } */ -typedef __thread int g4; /* { dg-error "multiple storage classes" } */ - -void foo() -{ - __thread int l1; /* { dg-error "implicitly auto and declared '__thread'" } */ - auto __thread int l2; /* { dg-error "multiple storage classes|data types" } */ - __thread extern int l3; /* { dg-error "'__thread' before 'extern'" } */ - register __thread int l4; /* { dg-error "multiple storage classes" } */ -} - -__thread void f1 (); /* { dg-error "invalid for function" } */ -extern __thread void f2 (); /* { dg-error "invalid for function" } */ -static __thread void f3 (); /* { dg-error "invalid for function" } */ -__thread void f4 () { } /* { dg-error "invalid for function" } */ - -void bar(__thread int p1); /* { dg-error "(invalid in parameter)|(specified for parameter)" } */ - -struct A { - __thread int i; /* { dg-error "storage class specified" } */ -}; diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-3.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-3.C deleted file mode 100644 index ea5158b89..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-3.C +++ /dev/null @@ -1,11 +0,0 @@ -// Report invalid extern and __thread combinations. -// { dg-require-effective-target tls } - -extern int j; // { dg-error "previously declared here" } -__thread int j; // { dg-error "follows non-thread-local" } - -extern __thread int i; // { dg-error "previously declared here" } -int i; // { dg-error "follows thread-local" } - -extern __thread int k; // This is fine. -__thread int k; diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-4.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-4.C deleted file mode 100644 index 7d07d9deb..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-4.C +++ /dev/null @@ -1,10 +0,0 @@ -/* Invalid __thread specifiers. */ -/* { dg-require-effective-target tls } */ - -__thread typedef int g4; /* { dg-error "multiple storage classes" } */ - -void foo() -{ - __thread auto int l2; /* { dg-error "multiple storage classes|data types" } */ - __thread register int l4; /* { dg-error "multiple storage classes" } */ -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-5.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-5.C deleted file mode 100644 index ca92b3074..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/diag-5.C +++ /dev/null @@ -1,5 +0,0 @@ -// PR c++/30536 -// Invalid __thread specifiers. -// { dg-require-effective-target tls } - -struct A { __thread register int i; }; // { dg-error "multiple storage classes|storage class specified" } diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/init-1.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/init-1.C deleted file mode 100644 index 97867123a..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/init-1.C +++ /dev/null @@ -1,14 +0,0 @@ -/* Valid initializations. */ -/* { dg-require-effective-target tls } */ - -__thread int i = 42; - -static int j; -__thread int *p = &j; - -/* Note that this is valid in C++ (unlike C) as a run-time initialization. */ -int *q = &i; - -/* Valid because "const int k" is an integral constant expression in C++. */ -__thread const int k = 42; -__thread const int l = k; diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/init-2.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/init-2.C deleted file mode 100644 index 327c309e9..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/init-2.C +++ /dev/null @@ -1,14 +0,0 @@ -/* Invalid initializations. */ -/* { dg-require-effective-target tls } */ - -extern __thread int i; -__thread int *p = &i; /* { dg-error "dynamic initialization" } */ - -extern int f(); -__thread int j = f(); /* { dg-error "dynamic initialization" } */ - -struct S -{ - S(); -}; -__thread S s; /* { dg-error "dynamic initialization" } */ diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/static-1.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/static-1.C deleted file mode 100644 index 506b0fcf7..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/static-1.C +++ /dev/null @@ -1,30 +0,0 @@ -// { dg-do run } -// { dg-options "-O2" } -// { dg-require-effective-target tls_runtime } -// { dg-add-options tls } -// { dg-additional-sources "static-1a.cc" } - -extern "C" void abort (); -extern int test (); - -struct A -{ - static __thread int i; -}; - -__thread int A::i = 8; - -int -main () -{ - if (A::i != 8) - abort (); - - if (test ()) - abort (); - - if (A::i != 17) - abort (); - - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/static-1a.cc b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/static-1a.cc deleted file mode 100644 index 1c6109f86..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/static-1a.cc +++ /dev/null @@ -1,20 +0,0 @@ -// { dg-do run } -// { dg-options "-O2" } -// { dg-require-effective-target tls_runtime } -// { dg-add-options tls } -// { dg-additional-sources "static-1a.cc" } - -struct A -{ - static __thread int i; -}; - -int -test () -{ - if (A::i != 8) - return 1; - - A::i = 17; - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/static2.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/static2.C deleted file mode 100644 index ab688dd8d..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/static2.C +++ /dev/null @@ -1,18 +0,0 @@ -// { dg-final { scan-assembler-not "_ZTHN1A1iE" } } -// { dg-final { scan-assembler-not "_ZTWN1A1iE" } } -// { dg-require-effective-target tls } - -struct A -{ - static __thread int i; -}; - -int -test () -{ - if (A::i != 8) - return 1; - - A::i = 17; - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-cse.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-cse.C deleted file mode 100644 index 33064d67c..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-cse.C +++ /dev/null @@ -1,20 +0,0 @@ -// Test for CSE of the wrapper function: we should only call it once -// for the two references to ir. -// { dg-do run } -// { dg-options "-std=c++11 -O -fno-inline -save-temps" } -// { dg-add-options tls } -// { dg-require-effective-target tls_runtime } -// { dg-final { scan-assembler-times "call *_ZTW2ir" 1 { xfail *-*-* } } } -// { dg-final cleanup-saved-temps } - -// XFAILed until the back end supports a way to mark a function as cseable -// though not pure. - -int f() { return 42; } - -thread_local int ir = f(); - -int main() -{ - return ir + ir - 84; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-ice.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-ice.C deleted file mode 100644 index 174aac42a..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-ice.C +++ /dev/null @@ -1,6 +0,0 @@ -// PR c++/55801 -// { dg-options "-std=c++11" } -// { dg-require-effective-target tls } - -class C; -thread_local C O, O2 = O; // { dg-error "incomplete" } diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-order1.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-order1.C deleted file mode 100644 index 10b53af83..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-order1.C +++ /dev/null @@ -1,26 +0,0 @@ -// { dg-do run } -// { dg-options "-std=c++11" } -// { dg-add-options tls } -// { dg-require-effective-target tls_runtime } -// { dg-require-cxa-atexit "" } - -extern "C" void abort(); -extern "C" int printf (const char *, ...); -#define printf(...) - -int c; -struct A { - int i; - A(int i): i(i) { printf ("A(%d)\n", i); if (i != c++) abort (); } - ~A() { printf("~A(%d)\n", i); if (i != --c) abort(); } -}; - -A a0(0); -thread_local A a1(1); -thread_local A a2(2); -A* ap = &a1; - -int main() -{ - if (c != 3) abort(); -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-order2.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-order2.C deleted file mode 100644 index a24df28eb..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-order2.C +++ /dev/null @@ -1,28 +0,0 @@ -// The standard says that a1 should be destroyed before a0 even though -// that isn't reverse order of construction. We need to move -// __cxa_thread_atexit into glibc to get this right. - -// { dg-do run { xfail *-*-* } } -// { dg-options "-std=c++11" } -// { dg-add-options tls } -// { dg-require-effective-target tls_runtime } - -extern "C" void abort(); -extern "C" int printf (const char *, ...); -#define printf(...) - -int c; -struct A { - int i; - A(int i): i(i) { printf ("A(%d)\n", i); ++c; } - ~A() { printf("~A(%d)\n", i); if (i != --c) abort(); } -}; - -thread_local A a1(1); -A* ap = &a1; -A a0(0); - -int main() -{ - if (c != 2) abort(); -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap1.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap1.C deleted file mode 100644 index 56177da1f..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap1.C +++ /dev/null @@ -1,13 +0,0 @@ -// If we can see the definition at the use site, we don't need to bother -// with a wrapper. - -// { dg-require-effective-target tls } -// { dg-options "-std=c++11" } -// { dg-final { scan-assembler-not "_ZTW1i" } } - -thread_local int i = 42; - -int main() -{ - return i - 42; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap2.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap2.C deleted file mode 100644 index 1e8078fa8..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap2.C +++ /dev/null @@ -1,16 +0,0 @@ -// If we can't see the definition at the use site, but it's in this translation -// unit, we build a wrapper but don't bother with an init function. - -// { dg-require-effective-target tls } -// { dg-options "-std=c++11" } -// { dg-final { scan-assembler "_ZTW1i" } } -// { dg-final { scan-assembler-not "_ZTH1i" } } - -extern thread_local int i; - -int main() -{ - return i - 42; -} - -thread_local int i = 42; diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap3.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap3.C deleted file mode 100644 index ca40e52b5..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap3.C +++ /dev/null @@ -1,15 +0,0 @@ -// If we can't see the definition at all, we need to assume there might be -// an init function. - -// { dg-require-alias "" } -// { dg-require-effective-target tls } -// { dg-options "-std=c++11" } -// { dg-final { scan-assembler "_ZTW1i" } } -// { dg-final { scan-assembler "_ZTH1i" } } - -extern thread_local int i; - -int main() -{ - return i - 42; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap4.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap4.C deleted file mode 100644 index 7c8481cc2..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local-wrap4.C +++ /dev/null @@ -1,14 +0,0 @@ -// We don't need to call the wrapper through the PLT; we can use a separate -// copy per shared object. - -// { dg-require-effective-target tls } -// { dg-require-effective-target fpic } -// { dg-options "-std=c++11 -fPIC" } -// { dg-final { scan-assembler-not "_ZTW1i@PLT" { target i?86-*-* x86_64-*-* } } } - -extern thread_local int i; - -int main() -{ - return i - 42; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local1.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local1.C deleted file mode 100644 index e7734a0ba..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local1.C +++ /dev/null @@ -1,21 +0,0 @@ -// { dg-options "-std=c++11" } -// { dg-require-effective-target tls } - -// The variable should have a guard. -// { dg-final { scan-assembler "_ZGVZ1fvE1a" } } -// But since it's thread local we don't need to guard against -// simultaneous execution. -// { dg-final { scan-assembler-not "cxa_guard" } } -// The guard should be TLS, not local common. -// { dg-final { scan-assembler-not "\.comm" } } - -struct A -{ - A(); -}; - -A &f() -{ - thread_local A a; - return a; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local2.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local2.C deleted file mode 100644 index bb255de7a..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local2.C +++ /dev/null @@ -1,28 +0,0 @@ -// { dg-do run } -// { dg-options "-std=c++11" } -// { dg-add-options tls } -// { dg-require-effective-target tls_runtime } - -extern "C" void abort(); - -struct A -{ - A(); - int i; -}; - -A &f() -{ - thread_local A a; - return a; -} - -int j; -A::A(): i(j) { } - -int main() -{ - j = 42; - if (f().i != 42) - abort (); -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local2g.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local2g.C deleted file mode 100644 index e84ef56e0..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local2g.C +++ /dev/null @@ -1,29 +0,0 @@ -// { dg-do run } -// { dg-options "-std=c++11" } -// { dg-add-options tls } -// { dg-require-effective-target tls_runtime } - -extern "C" void abort(); - -struct A -{ - A(); - int i; -}; - -thread_local A a; - -A &f() -{ - return a; -} - -int j; -A::A(): i(j) { } - -int main() -{ - j = 42; - if (f().i != 42) - abort (); -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local3.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local3.C deleted file mode 100644 index e05a0b953..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local3.C +++ /dev/null @@ -1,38 +0,0 @@ -// { dg-do run } -// { dg-require-effective-target c++11 } -// { dg-require-effective-target tls_runtime } -// { dg-require-effective-target pthread } -// { dg-options -pthread } -// { dg-add-options tls } - -int c; -int d; -struct A -{ - A() { ++c; } - ~A() { ++d; } -}; - -void f() -{ - thread_local A a; -} - -void *thread_main(void *) -{ - f(); f(); f(); -} - -#include <pthread.h> - -int main() -{ - pthread_t thread; - pthread_create (&thread, 0, thread_main, 0); - pthread_join(thread, 0); - pthread_create (&thread, 0, thread_main, 0); - pthread_join(thread, 0); - - if (c != 2 || d != 2) - __builtin_abort(); -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local3g.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local3g.C deleted file mode 100644 index a3c9ebcc2..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local3g.C +++ /dev/null @@ -1,36 +0,0 @@ -// { dg-do run } -// { dg-require-effective-target c++11 } -// { dg-require-effective-target tls_runtime } -// { dg-require-effective-target pthread } -// { dg-require-cxa-atexit "" } -// { dg-options -pthread } -// { dg-add-options tls } - -int c; -int d; -struct A -{ - A() { ++c; } - ~A() { ++d; } -}; - -thread_local A a; - -void *thread_main(void *) -{ - A* ap = &a; -} - -#include <pthread.h> - -int main() -{ - pthread_t thread; - pthread_create (&thread, 0, thread_main, 0); - pthread_join(thread, 0); - pthread_create (&thread, 0, thread_main, 0); - pthread_join(thread, 0); - - if (c != 2 || d != 2) - __builtin_abort(); -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local4.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local4.C deleted file mode 100644 index acf1cae52..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local4.C +++ /dev/null @@ -1,48 +0,0 @@ -// Test for cleanups with pthread_cancel. - -// { dg-do run } -// { dg-require-effective-target c++11 } -// { dg-require-effective-target tls_runtime } -// { dg-require-effective-target pthread } -// { dg-options -pthread } -// { dg-add-options tls } - -#include <pthread.h> -#include <unistd.h> - -int c; -int d; -struct A -{ - A() { ++c; } - ~A() { ++d; } -}; - -void f() -{ - thread_local A a; -} - -void *thread_main(void *) -{ - f(); f(); f(); - while (true) - { - pthread_testcancel(); - sleep (1); - } -} - -int main() -{ - pthread_t thread; - pthread_create (&thread, 0, thread_main, 0); - pthread_cancel(thread); - pthread_join(thread, 0); - pthread_create (&thread, 0, thread_main, 0); - pthread_cancel(thread); - pthread_join(thread, 0); - - if (c != 2 || d != 2) - __builtin_abort(); -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local4g.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local4g.C deleted file mode 100644 index f5bc3ffa8..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local4g.C +++ /dev/null @@ -1,46 +0,0 @@ -// Test for cleanups with pthread_cancel. - -// { dg-do run } -// { dg-require-effective-target c++11 } -// { dg-require-effective-target tls_runtime } -// { dg-require-effective-target pthread } -// { dg-require-cxa-atexit "" } -// { dg-options -pthread } -// { dg-add-options tls } - -#include <pthread.h> -#include <unistd.h> - -int c; -int d; -struct A -{ - A() { ++c; } - ~A() { ++d; } -}; - -thread_local A a; - -void *thread_main(void *) -{ - A *ap = &a; - while (true) - { - pthread_testcancel(); - sleep (1); - } -} - -int main() -{ - pthread_t thread; - pthread_create (&thread, 0, thread_main, 0); - pthread_cancel(thread); - pthread_join(thread, 0); - pthread_create (&thread, 0, thread_main, 0); - pthread_cancel(thread); - pthread_join(thread, 0); - - if (c != 2 || d != 2) - __builtin_abort(); -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local5.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local5.C deleted file mode 100644 index 8d17584ed..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local5.C +++ /dev/null @@ -1,48 +0,0 @@ -// Test for cleanups in the main thread, too. - -// { dg-do run } -// { dg-require-effective-target c++11 } -// { dg-require-effective-target tls_runtime } -// { dg-require-effective-target pthread } -// { dg-options -pthread } -// { dg-add-options tls } - -#include <pthread.h> -#include <unistd.h> - -int c; -int d; -struct A -{ - A() { ++c; } - ~A() { - if (++d == 3) - _exit (0); - } -}; - -void f() -{ - thread_local A a; -} - -void *thread_main(void *) -{ - f(); f(); f(); -} - -int main() -{ - pthread_t thread; - thread_main(0); - pthread_create (&thread, 0, thread_main, 0); - pthread_join(thread, 0); - pthread_create (&thread, 0, thread_main, 0); - pthread_join(thread, 0); - - // The dtor for a in the main thread is run after main exits, so we - // return 1 now and override the return value with _exit above. - if (c != 3 || d != 2) - __builtin_abort(); - return 1; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local5g.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local5g.C deleted file mode 100644 index f87b0382d..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local5g.C +++ /dev/null @@ -1,46 +0,0 @@ -// Test for cleanups in the main thread, too. - -// { dg-do run } -// { dg-require-effective-target c++11 } -// { dg-require-effective-target tls_runtime } -// { dg-require-effective-target pthread } -// { dg-require-cxa-atexit "" } -// { dg-options -pthread } -// { dg-add-options tls } - -#include <pthread.h> -#include <unistd.h> - -int c; -int d; -struct A -{ - A() { ++c; } - ~A() { - if (++d == 3) - _exit (0); - } -}; - -thread_local A a; - -void *thread_main(void *) -{ - A* ap = &a; -} - -int main() -{ - pthread_t thread; - thread_main(0); - pthread_create (&thread, 0, thread_main, 0); - pthread_join(thread, 0); - pthread_create (&thread, 0, thread_main, 0); - pthread_join(thread, 0); - - // The dtor for a in the main thread is run after main exits, so we - // return 1 now and override the return value with _exit above. - if (c != 3 || d != 2) - __builtin_abort(); - return 1; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local6.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local6.C deleted file mode 100644 index 39dd6029e..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local6.C +++ /dev/null @@ -1,34 +0,0 @@ -// Test for cleanups in the main thread without -pthread. - -// { dg-do run } -// { dg-options "-std=c++11" } -// { dg-add-options tls } -// { dg-require-effective-target tls_runtime } - -extern "C" void _exit (int); - -int c; -struct A -{ - A() { ++c; } - ~A() { if (c == 1) _exit(0); } -}; - -void f() -{ - thread_local A a; -} - -void *thread_main(void *) -{ - f(); f(); f(); -} - -int main() -{ - thread_main(0); - - // The dtor for a in the main thread is run after main exits, so we - // return 1 now and override the return value with _exit above. - return 1; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local6g.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local6g.C deleted file mode 100644 index 70e97d3b2..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local6g.C +++ /dev/null @@ -1,32 +0,0 @@ -// Test for cleanups in the main thread without -pthread. - -// { dg-do run } -// { dg-options "-std=c++11" } -// { dg-add-options tls } -// { dg-require-effective-target tls_runtime } -// { dg-require-cxa-atexit "" } - -extern "C" void _exit (int); - -int c; -struct A -{ - A() { ++c; } - ~A() { if (c == 1) _exit(0); } -}; - -thread_local A a; - -void *thread_main(void *) -{ - A* ap = &a; -} - -int main() -{ - thread_main(0); - - // The dtor for a in the main thread is run after main exits, so we - // return 1 now and override the return value with _exit above. - return 1; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local7.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local7.C deleted file mode 100644 index f453b9657..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local7.C +++ /dev/null @@ -1,10 +0,0 @@ -// { dg-options "-std=c++11" } -// { dg-require-effective-target tls } - -// The reference temp should be TLS, not normal data. -// { dg-final { scan-assembler-not "\\.data" { target tls_native } } } - -void f() -{ - thread_local int&& ir = 42; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local7g.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local7g.C deleted file mode 100644 index 0fdfe7ef9..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/thread_local7g.C +++ /dev/null @@ -1,12 +0,0 @@ -// { dg-options "-std=c++11" } -// { dg-require-effective-target tls } - -// The reference temp should be TLS, not normal data. -// { dg-final { scan-assembler-not "\\.data" { target tls_native } } } - -thread_local int&& ir = 42; - -void f() -{ - ir = 24; -} diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/tls.exp b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/tls.exp deleted file mode 100644 index a52040d2d..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/tls.exp +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2002-2013 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. - -# Load support procs. -load_lib g++-dg.exp - -# If a testcase doesn't have special options, use these. -global DEFAULT_CXXFLAGS -if ![info exists DEFAULT_CXXFLAGS] then { - set DEFAULT_CXXFLAGS " -pedantic-errors -Wno-long-long" -} - -# Initialize `dg'. -dg-init - -# Main loop. -g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] $DEFAULT_CXXFLAGS - -# All done. -dg-finish diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/trivial.C b/gcc-4.8.1/gcc/testsuite/g++.dg/tls/trivial.C deleted file mode 100644 index e2b8f45b8..000000000 --- a/gcc-4.8.1/gcc/testsuite/g++.dg/tls/trivial.C +++ /dev/null @@ -1,3 +0,0 @@ -// { dg-require-effective-target tls } - -__thread int i; |