re-enable tls and lto tests for ObjC/C++
[official-gcc/alias-decl.git] / gcc / testsuite / objc.dg / torture / tls / thr-init-3.m
blob9f354b341859286c08671591ea54b744fa582da4
1 /* { dg-do run } */
2 /* { dg-require-effective-target tls } */
3 /* { dg-add-options tls } */
4 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
5 /* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.m" } */
7 #include "../../../objc-obj-c++-shared/Object1.h"
8 extern void _exit(int);
10 @interface tsObj: Object {
11   int ai ;
14 - (int) fa:(int) n;
16 @end
18 @implementation tsObj
20 - (int) fa:(int) n
22 static __thread int as = 3;
23   as += n ;
24   return as ;
27 @end
29 int main (int ac, char *av[])
31   int a ;
32   tsObj *to = [tsObj new];
33   
34   a = [to fa:5];
35   if ( a != 8 ) 
36     _exit (-(__LINE__)) ;
37   
38   return 0;