diff options
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/tls/init-2.mm')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/tls/init-2.mm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/tls/init-2.mm b/gcc/testsuite/obj-c++.dg/tls/init-2.mm new file mode 100644 index 000000000..dc886ba01 --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/tls/init-2.mm @@ -0,0 +1,14 @@ +/* Invalid initializations. */ +/* { dg-require-effective-target tls } */ + +extern __thread int i; +__thread int *p = &i; /* { dg-error "dynamically initialized" } */ + +extern int f(); +__thread int j = f(); /* { dg-error "dynamically initialized" } */ + +struct S +{ + S(); +}; +__thread S s; /* { dg-error "" } two errors here */ |