1 /* { dg-lto-do link } */
2 /* { dg-skip-if "" { ! { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } */
3 /* { dg-require-effective-target fpic } */
4 /* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} } */
5 /* { dg-suppress-ld-options {-fPIC} } */
6
7 void func(int n) {
8 static int __thread v = 0;
9 int i;
10 for (i = 0; i < n; ++i) {
11 volatile int *p = &v;
12 volatile int x __attribute__ ((unused)) = *p;
13 }
14 }
15
16 int main(int argc, char **argv) {
17 func(argc);
18 return 0;
19 }