| 1 |
/* { dg-do compile { target *-*-linux* } } */ |
| 2 |
/* { dg-options "-O2 -fpic -mno-direct-extern-access" } */ |
| 3 |
|
| 4 |
/* Weak initialized symbol with -fpic. */ |
| 5 |
__attribute__((weak, visibility("protected"))) |
| 6 |
int xxx = -1; |
| 7 |
|
| 8 |
int |
| 9 |
foo () |
| 10 |
{ |
| 11 |
return xxx; |
| 12 |
} |
| 13 |
|
| 14 |
/* { dg-final { scan-assembler "xxx\\(%rip\\)" { target { ! ia32 } } } } */ |
| 15 |
/* { dg-final { scan-assembler-not "xxx@GOTPCREL" { target { ! ia32 } } } } */ |
| 16 |
/* { dg-final { scan-assembler "xxx@GOTOFF" { target ia32 } } } */ |
| 17 |
/* { dg-final { scan-assembler-not "xxx@GOT\\(" { target ia32 } } } */ |
| 18 |
/* { dg-final { scan-assembler "\.section\[ \t]+.note.gnu.property," } } */ |
| 19 |
/* { dg-final { scan-assembler "\.long\[ \t]+0xb0008000" } } */ |
| 20 |
|