blob: 47c6aede339e9643b377566b64a9b3b6a96f15f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// Test for CSE of the wrapper function: we should only call it once
// for the two references to ir.
// { dg-options "-std=c++11 -O -fno-inline -save-temps" }
// { dg-require-effective-target tls_runtime }
// { dg-require-alias }
// { dg-final { scan-assembler-times "call *_ZTW2ir" 1 { xfail *-*-* } } }
// { dg-final cleanup-saved-temps }
// { dg-do run }
// XFAILed until the back end supports a way to mark a function as cseable
// though not pure.
int f() { return 42; }
thread_local int ir = f();
int main()
{
return ir + ir - 84;
}
|