Debian Codegraph @

gcc/testsuite/obj-c++.dg/torture/tls/thr-init-3.mm

raw
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
6 #include "../../../objc-obj-c++-shared/TestsuiteObject.m"
7 extern "C" {
8 extern void abort ();
9 }
10
11 @interface tsObj: TestsuiteObject {
12 int ai ;
13 }
14
15 - (int) fa:(int) n;
16
17 @end
18
19 @implementation tsObj
20
21 - (int) fa:(int) n
22 {
23 static __thread int as = 3;
24 as += n ;
25 return as ;
26 }
27
28 @end
29
30 int main (int ac, char *av[])
31 {
32 int a ;
33 tsObj *to = [tsObj new];
34
35 a = [to fa:5];
36 if ( a != 8 )
37 abort () ;
38
39 return 0;
40 }