OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [torture/] [tls/] [thr-init-2.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
// { dg-do run }
2
// { dg-require-effective-target tls_runtime }
3
// { dg-add-options tls }
4
 
5
extern void _exit(int);
6
 
7
__thread int glb =1 ;
8
 
9
static __thread int fstat = 2;
10
 
11
int fa(int a)
12
{
13
static __thread int as = 3;
14
  as += a ;
15
  return as;
16
}
17
 
18
int fb(int b)
19
{
20
static __thread int bs = 4;
21
  bs += b ;
22
  glb = bs;
23
  return bs;
24
}
25
 
26
int main (int ac, char *av[])
27
{
28
  int a = 1;
29
 
30
  a = fa(fstat);
31
  if ( a != 5 )
32
    _exit (-(__LINE__)) ;
33
 
34
  a = fa(glb);
35
  if ( a != 6 )
36
    _exit (-(__LINE__)) ;
37
 
38
  a = fb(a);
39
  if ( a != 10 || glb != 10 )
40
    _exit (-(__LINE__)) ;
41
 
42
  return 0;
43
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.