aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/gomp/tls-3.C
blob: c710b6d183582c8ff5f621b164c4b641ba9f94f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// { dg-do compile }
// { dg-require-effective-target tls }

#define thr threadprivate

int i;
#pragma omp thr (i)
namespace N
{
  int j;
#pragma omp thr (j)
};
struct S
{
  static int s;
#pragma omp thr (s)
};

int S::s = 5;

int
foo ()
{
  static int k;
#pragma omp thr (k)
  return k++ + S::s;
}