PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pie-copyrelocs-4.c
blob413cdf381c3a1ba6546ba21c0445b11b73f3748d
1 /* Check that GOTPCREL is used to access glob_a. */
2 /* { dg-do compile { target *-*-linux* } } */
3 /* { dg-require-effective-target pie_copyreloc } */
4 /* { dg-options "-O2 -fpie" } */
6 extern int glob_a __attribute__((weak));
8 int foo ()
10 if (&glob_a != 0)
11 return glob_a;
12 else
13 return 0;
16 /* weak glob_a should be accessed with a GOTPCREL. */
17 /* { dg-final { scan-assembler "glob_a@GOTPCREL" { target { ! ia32 } } } } */