aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/gomp/tls-wrapper-cse.C
blob: af2de2f1fcc7151248ee964732a617e3cb965d5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test for CSE of the wrapper function: we should only call it once
// for the two references to ir.
// { dg-options "-fopenmp -O -fno-inline" }
// { dg-require-effective-target tls }
// { dg-final { scan-assembler-times "call *_ZTW2ir" 1 { xfail *-*-* } } }

// XFAILed until the back end supports a way to mark a function as cseable
// though not pure.

int f() { return 42; }

int ir = f();
#pragma omp threadprivate (ir)

int main()
{
  return ir + ir - 84;
}