diff options
Diffstat (limited to 'gcc/testsuite/objc.dg/torture/tls/thr-init.m')
-rw-r--r-- | gcc/testsuite/objc.dg/torture/tls/thr-init.m | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/torture/tls/thr-init.m b/gcc/testsuite/objc.dg/torture/tls/thr-init.m new file mode 100644 index 000000000..986b425f7 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/tls/thr-init.m @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-require-effective-target tls_runtime } */ +/* { dg-add-options tls } */ + +extern void _exit(int); + +static __thread int fstat ; + +static __thread int fstat = 1; + +static __thread int fstat ; + +int test_code(int b) +{ + fstat += b ; + return fstat; +} + +int main (int ac, char *av[]) +{ + int a = test_code(1); + + if ( a != 2 || fstat != 2 ) _exit (-(__LINE__)) ; + + return 0; +} |