Since non-PIC noplt works on 32-bit x86 target now with assembler/linker support, enable non-PIC noplt tests on 32-bit x86 target. main in noplt-2.c and noplt-4.c are renamed to bar to avoid stack re-alignment in main for 32-bit target, which disables tailcall optimization.
Tested on x86. OK for trunk? H.J. --- * gcc.target/i386/noplt-1.c: Don't disable for ia32. Scan for ia32 if R_386_GOT32X relocation is supported. * gcc.target/i386/noplt-3.c: Likewise. * gcc.target/i386/noplt-2.c: Likewise. (main): Renamed to ... (bar): This. * gcc.target/i386/noplt-4.c: Likewise. (main): Renamed to ... (bar): This. * gcc.target/i386/pr67400-3.c: Don't disable for ia32. * gcc.target/i386/pr67400-5.c: Likewise. --- gcc/testsuite/gcc.target/i386/noplt-1.c | 5 +++-- gcc/testsuite/gcc.target/i386/noplt-2.c | 7 ++++--- gcc/testsuite/gcc.target/i386/noplt-3.c | 5 +++-- gcc/testsuite/gcc.target/i386/noplt-4.c | 7 ++++--- gcc/testsuite/gcc.target/i386/pr67400-3.c | 2 +- gcc/testsuite/gcc.target/i386/pr67400-5.c | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/gcc/testsuite/gcc.target/i386/noplt-1.c b/gcc/testsuite/gcc.target/i386/noplt-1.c index cc04bf5..f099a38 100644 --- a/gcc/testsuite/gcc.target/i386/noplt-1.c +++ b/gcc/testsuite/gcc.target/i386/noplt-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */ +/* { dg-do compile { target *-*-linux* } } */ /* { dg-options "-fno-pic" } */ __attribute__ ((noplt)) @@ -10,4 +10,5 @@ int main() return 0; } -/* { dg-final { scan-assembler "call\[ \t\]\\*.*foo.*@GOTPCREL\\(%rip\\)" } } */ +/* { dg-final { scan-assembler "call\[ \t\]*.foo@GOTPCREL" { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler "call\[ \t\]*.foo@GOT" { target { ia32 && got32x_reloc } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/noplt-2.c b/gcc/testsuite/gcc.target/i386/noplt-2.c index 54e33f4..9548b81 100644 --- a/gcc/testsuite/gcc.target/i386/noplt-2.c +++ b/gcc/testsuite/gcc.target/i386/noplt-2.c @@ -1,13 +1,14 @@ -/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */ +/* { dg-do compile { target *-*-linux* } } */ /* { dg-options "-O2 -fno-pic" } */ __attribute__ ((noplt)) int foo(); -int main() +int bar() { return foo(); } -/* { dg-final { scan-assembler "jmp\[ \t\]\\*.*foo.*@GOTPCREL\\(%rip\\)" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*.foo@GOTPCREL" { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*.foo@GOT" { target { ia32 && got32x_reloc } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/noplt-3.c b/gcc/testsuite/gcc.target/i386/noplt-3.c index 14e6b6b..436c0d1 100644 --- a/gcc/testsuite/gcc.target/i386/noplt-3.c +++ b/gcc/testsuite/gcc.target/i386/noplt-3.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */ +/* { dg-do compile { target *-*-linux* } } */ /* { dg-options "-fno-pic -fno-plt" } */ void foo(); @@ -9,4 +9,5 @@ int main() return 0; } -/* { dg-final { scan-assembler "call\[ \t\]\\*.*foo.*@GOTPCREL\\(%rip\\)" } } */ +/* { dg-final { scan-assembler "call\[ \t\]*.foo@GOTPCREL" { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler "call\[ \t\]*.foo@GOT" { target { ia32 && got32x_reloc } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/noplt-4.c b/gcc/testsuite/gcc.target/i386/noplt-4.c index 9907347..b89fcf0 100644 --- a/gcc/testsuite/gcc.target/i386/noplt-4.c +++ b/gcc/testsuite/gcc.target/i386/noplt-4.c @@ -1,11 +1,12 @@ -/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */ +/* { dg-do compile { target *-*-linux* } } */ /* { dg-options "-O2 -fno-pic -fno-plt" } */ int foo(); -int main() +int bar() { return foo(); } -/* { dg-final { scan-assembler "jmp\[ \t\]\\*.*foo.*@GOTPCREL\\(%rip\\)" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*.foo@GOTPCREL" { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*.foo@GOT" { target { ia32 && got32x_reloc } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr67400-3.c b/gcc/testsuite/gcc.target/i386/pr67400-3.c index 649c980..fd2f209 100644 --- a/gcc/testsuite/gcc.target/i386/pr67400-3.c +++ b/gcc/testsuite/gcc.target/i386/pr67400-3.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */ +/* { dg-do compile { target *-*-linux* } } */ /* { dg-options "-O2 -fno-pic -fno-plt" } */ static void diff --git a/gcc/testsuite/gcc.target/i386/pr67400-5.c b/gcc/testsuite/gcc.target/i386/pr67400-5.c index 2d26a68..9bb98dc 100644 --- a/gcc/testsuite/gcc.target/i386/pr67400-5.c +++ b/gcc/testsuite/gcc.target/i386/pr67400-5.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */ +/* { dg-do compile { target *-*-linux* } } */ /* { dg-options "-O2 -fno-pic -fno-plt" } */ extern void foo (void); -- 2.5.5