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 { target c++11 } }
4 // { dg-options "-O -fno-inline -save-temps" }
5 // { dg-add-options tls }
6 // { dg-require-effective-target tls_runtime }
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
13 int f() { return 42; }
15 thread_local int ir = f();