gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c
raw| 1 | /* Check that GOTPCREL isn't used to access glob_a. */ |
| 2 | /* { dg-do compile { target *-*-linux* } } */ |
| 3 | /* { dg-require-effective-target pie_copyreloc } */ |
| 4 | /* { dg-options "-O2 -fpie" } */ |
| 5 | |
| 6 | extern int glob_a; |
| 7 | |
| 8 | int foo () |
| 9 | { |
| 10 | return glob_a; |
| 11 | } |
| 12 | |
| 13 | /* glob_a should never be accessed with a GOTPCREL. */ |
| 14 | /* { dg-final { scan-assembler-not "glob_a@GOTPCREL" { target { ! ia32 } } } } */ |