1/* { dg-do compile { target *-*-linux* } } */
2/* { dg-options "-O2 -fpie" } */
3
4/* Weak initialized symbol with -fpie.  */
5__attribute__((weak))
6int xxx = -1;
7
8int
9foo ()
10{
11  return xxx;
12}
13
14/* { dg-final { scan-assembler "movl\[ \t\]xxx\\(%rip\\), %eax" { target { ! ia32 } } } } */
15/* { dg-final { scan-assembler-not "xxx@GOTPCREL" { target { ! ia32 } } } } */
16/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %eax" { target ia32 } } } */
17/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target ia32 } } } */
18