PR middle-end/77674
[official-gcc.git] / gcc / testsuite / g++.dg / gomp / tls-wrapper-cse.C
blobaf2de2f1fcc7151248ee964732a617e3cb965d5f
1 // Test for CSE of the wrapper function: we should only call it once
2 // for the two references to ir.
3 // { dg-options "-fopenmp -O -fno-inline" }
4 // { dg-require-effective-target tls }
5 // { dg-final { scan-assembler-times "call *_ZTW2ir" 1 { xfail *-*-* } } }
7 // XFAILed until the back end supports a way to mark a function as cseable
8 // though not pure.
10 int f() { return 42; }
12 int ir = f();
13 #pragma omp threadprivate (ir)
15 int main()
17   return ir + ir - 84;