* g++.dg/tls/thread_local-order1.C: Add dg-require-cxa-atexit.
[official-gcc.git] / gcc / testsuite / g++.dg / tls / thread_local-cse.C
blobe3b13787d4d364f2bc48058083d0fcbe44e1d0b3
1 // Test for CSE of the wrapper function: we should only call it once
2 // for the two references to ir.
3 // { dg-do run { xfail *-*-solaris2.9 } }
4 // { dg-options "-std=c++11 -O -fno-inline -save-temps" }
5 // { dg-require-effective-target tls_runtime }
6 // { dg-require-alias }
7 // { dg-final { scan-assembler-times "call *_ZTW2ir" 1 { xfail *-*-* } } }
8 // { dg-final cleanup-saved-temps }
10 // XFAILed until the back end supports a way to mark a function as cseable
11 // though not pure.
13 int f() { return 42; }
15 thread_local int ir = f();
17 int main()
19   return ir + ir - 84;