| 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 *-*-* } } } |
| 6 |
|
| 7 |
// XFAILed until the back end supports a way to mark a function as cseable |
| 8 |
// though not pure. |
| 9 |
|
| 10 |
int f() { return 42; } |
| 11 |
|
| 12 |
int ir = f(); |
| 13 |
#pragma omp threadprivate (ir) |
| 14 |
|
| 15 |
int main() |
| 16 |
{ |
| 17 |
return ir + ir - 84; |
| 18 |
} |