1/* { dg-do run } */
2/* { dg-require-effective-target tls_runtime } */
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"
7extern void _exit(int);
8
9@interface tsObj: TestsuiteObject {
10  int ai ;
11}
12
13- (int) fa:(int) n;
14
15@end
16
17@implementation tsObj
18
19- (int) fa:(int) n
20{
21static __thread int as = 3;
22  as += n ;
23  return as ;
24}
25
26@end
27
28int main (int ac, char *av[])
29{
30  int a ;
31  tsObj *to = [tsObj new];
32
33  a = [to fa:5];
34  if ( a != 8 )
35    _exit (-(__LINE__)) ;
36
37  return 0;
38}
39