diff options
author | Richard Henderson <rth@redhat.com> | 2002-05-21 18:12:13 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-05-21 18:12:13 -0700 |
commit | ec221d715c730de2214d2bf4cab8b37633787ff7 (patch) | |
tree | 2363f267a50cd81662c0013864728e3a333a0cc0 /gcc/testsuite/gcc.dg/tls/diag-2.c | |
parent | 3d78f2e96e29feaff7046c22fdc97aa58bee9688 (diff) | |
download | gcc-ec221d715c730de2214d2bf4cab8b37633787ff7.zip gcc-ec221d715c730de2214d2bf4cab8b37633787ff7.tar.gz gcc-ec221d715c730de2214d2bf4cab8b37633787ff7.tar.bz2 |
tls.exp, [...]: New directory and files.
* gcc.dg/tls/tls.exp, gcc.dg/tls/trivial.c, gcc.dg/tls/diag-1.c,
gcc.dg/tls/diag-2.c, gcc.dg/tls/init-1.c: New directory and files.
From-SVN: r53716
Diffstat (limited to 'gcc/testsuite/gcc.dg/tls/diag-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tls/diag-2.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tls/diag-2.c b/gcc/testsuite/gcc.dg/tls/diag-2.c new file mode 100644 index 0000000..4f2b90b --- /dev/null +++ b/gcc/testsuite/gcc.dg/tls/diag-2.c @@ -0,0 +1,21 @@ +/* Invalid __thread specifiers. */ + +__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" } */ + __thread extern int l3; /* { dg-error "`__thread' before `extern'" } */ + register __thread int l4; /* { dg-error "multiple storage classes" } */ +} + +__thread void f1 (); /* { dg-error "invalid storage class for function" } */ +extern __thread void f2 (); /* { dg-error "invalid storage class for function" } */ +static __thread void f3 (); /* { dg-error "invalid storage class for function" } */ +__thread void f4 () { } /* { dg-error "function definition declared `__thread'" } */ + +void bar(__thread int p1); /* { dg-error "storage class specified for parameter" } */ |