diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/objc.dg/tls | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/objc.dg/tls')
-rw-r--r-- | gcc/testsuite/objc.dg/tls/diag-2.m | 26 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/tls/diag-3.m | 11 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/tls/diag-4.m | 10 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/tls/diag-5.m | 4 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/tls/init-1.m | 5 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/tls/init-2.m | 14 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/tls/tls.exp | 26 |
7 files changed, 96 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/tls/diag-2.m b/gcc/testsuite/objc.dg/tls/diag-2.m new file mode 100644 index 000000000..4f22281eb --- /dev/null +++ b/gcc/testsuite/objc.dg/tls/diag-2.m @@ -0,0 +1,26 @@ +/* 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 " '__thread' used with 'typedef'" } */ + +void foo() +{ + __thread int l1; /* { dg-error "implicitly auto and declared '__thread'" } */ + auto __thread int l2; /* { dg-error "'__thread' used with 'auto'" } */ + __thread extern int l3; /* { dg-error "'__thread' before 'extern'" } */ + register __thread int l4; /* { dg-error "'__thread' used with 'register'" } */ +} + +__thread void f1 (); /* { dg-error "invalid storage class for function 'f1'" } */ +extern __thread void f2 (); /* { dg-error "invalid storage class for function 'f2'" } */ +static __thread void f3 (); /* { dg-error "invalid storage class for function 'f3'" } */ +__thread void f4 () { } /* { dg-error "function definition declared '__thread'" } */ + +void bar(__thread int p1); /* { dg-error "(invalid in parameter)|(specified for parameter)" } */ + +struct A { + __thread int i; /* { dg-error "expected specifier-qualifier-list before '__thread'" } */ +}; diff --git a/gcc/testsuite/objc.dg/tls/diag-3.m b/gcc/testsuite/objc.dg/tls/diag-3.m new file mode 100644 index 000000000..c71f66fb8 --- /dev/null +++ b/gcc/testsuite/objc.dg/tls/diag-3.m @@ -0,0 +1,11 @@ +/* Report invalid extern and __thread combinations. */ +/* { dg-require-effective-target tls } */ + +extern int j; /* { dg-message "previous declaration of 'j' was here" } */ +__thread int j; /* { dg-error "follows non-thread-local" } */ + +extern __thread int i; /* { dg-message "previous declaration of 'i' was here" } */ +int i; /* { dg-error "follows thread-local" } */ + +extern __thread int k; /* This is fine. */ +__thread int k; diff --git a/gcc/testsuite/objc.dg/tls/diag-4.m b/gcc/testsuite/objc.dg/tls/diag-4.m new file mode 100644 index 000000000..38a5b3aba --- /dev/null +++ b/gcc/testsuite/objc.dg/tls/diag-4.m @@ -0,0 +1,10 @@ +/* Invalid __thread specifiers. */ +/* { dg-require-effective-target tls } */ + +__thread typedef int g4; /* { dg-error "'__thread' used with 'typedef'" } */ + +void foo() +{ + __thread auto int l2; /* { dg-error "'__thread' used with 'auto'" } */ + __thread register int l4; /* { dg-error "'__thread' used with 'register'" } */ +} diff --git a/gcc/testsuite/objc.dg/tls/diag-5.m b/gcc/testsuite/objc.dg/tls/diag-5.m new file mode 100644 index 000000000..ac78cb295 --- /dev/null +++ b/gcc/testsuite/objc.dg/tls/diag-5.m @@ -0,0 +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/objc.dg/tls/init-1.m b/gcc/testsuite/objc.dg/tls/init-1.m new file mode 100644 index 000000000..fa4208dce --- /dev/null +++ b/gcc/testsuite/objc.dg/tls/init-1.m @@ -0,0 +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/objc.dg/tls/init-2.m b/gcc/testsuite/objc.dg/tls/init-2.m new file mode 100644 index 000000000..882e5f809 --- /dev/null +++ b/gcc/testsuite/objc.dg/tls/init-2.m @@ -0,0 +1,14 @@ +/* Invalid initializations. */ +/* { dg-require-effective-target tls } */ + +extern __thread int i; +__thread int *p = &i; /* { dg-error "initializer element is not constant" } */ + +extern int f(); +__thread int j = f(); /* { dg-error "initializer element is not constant" } */ + +struct S +{ + S(); /* { dg-error "expected specifier-qualifier-list before 'S'" } */ +}; +__thread S s; /* { dg-error "unknown type name" } */ diff --git a/gcc/testsuite/objc.dg/tls/tls.exp b/gcc/testsuite/objc.dg/tls/tls.exp new file mode 100644 index 000000000..5b30a70ff --- /dev/null +++ b/gcc/testsuite/objc.dg/tls/tls.exp @@ -0,0 +1,26 @@ + +# Load support procs. +load_lib objc-dg.exp + +# If a testcase doesn't have special options, use these. +global DEFAULT_CFLAGS +if ![info exists DEFAULT_CFLAGS] then { + set DEFAULT_CFLAGS "" +} + +# Initialize `dg'. +dg-init + +# Gather a list of all tests. +set tests [lsort [glob -nocomplain $srcdir/$subdir/*.m]] + +# Main loop. +dg-runtest $tests "-fgnu-runtime" $DEFAULT_CFLAGS + +# darwin targets can also run code with the NeXT runtime. +if [istarget "*-*-darwin*" ] { + dg-runtest $tests "-fnext-runtime" $DEFAULT_CFLAGS +} + +# All done. +dg-finish |