From aa23a2dd53f67f5cb4cbfa7038c2fc48caa82cc3 Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Tue, 3 Nov 2020 09:51:43 +0000 Subject: [PATCH] Add dg-require-effective-target fpic to gcc i386 tests This change adds /* { dg-require-effective-target fpic } */ to tests in gcc.target/i386 that do use -fpic or -fPIC but don't currently query the target support. This corresponds to what many other fpic tests do and helps the vxWorks ports at least, as -fpic is typically not supported in at least one of the two major modes of such port (kernel vs RTP). 2020-11-03 Olivier Hainque gcc/testsuite/ * gcc.target/i386/pr45352-1.c: Add dg-require-effective-target fpic. * gcc.target/i386/pr47602.c: Likewise. * gcc.target/i386/pr55151.c: Likewise. * gcc.target/i386/pr55458.c: Likewise. * gcc.target/i386/pr56348.c: Likewise. * gcc.target/i386/pr57097.c: Likewise. * gcc.target/i386/pr65753.c: Likewise. * gcc.target/i386/pr65915.c: Likewise. * gcc.target/i386/pr66232-5.c: Likewise. * gcc.target/i386/pr66334.c: Likewise. * gcc.target/i386/pr66819-2.c: Likewise. * gcc.target/i386/pr67265.c: Likewise. * gcc.target/i386/pr81481.c: Likewise. * gcc.target/i386/pr83994.c: Likewise. --- gcc/testsuite/gcc.target/i386/pr45352-1.c | 1 + gcc/testsuite/gcc.target/i386/pr47602.c | 1 + gcc/testsuite/gcc.target/i386/pr55151.c | 1 + gcc/testsuite/gcc.target/i386/pr55458.c | 1 + gcc/testsuite/gcc.target/i386/pr56348.c | 1 + gcc/testsuite/gcc.target/i386/pr57097.c | 1 + gcc/testsuite/gcc.target/i386/pr65753.c | 1 + gcc/testsuite/gcc.target/i386/pr65915.c | 1 + gcc/testsuite/gcc.target/i386/pr66232-5.c | 1 + gcc/testsuite/gcc.target/i386/pr66334.c | 1 + gcc/testsuite/gcc.target/i386/pr66819-2.c | 1 + gcc/testsuite/gcc.target/i386/pr67265.c | 1 + gcc/testsuite/gcc.target/i386/pr81481.c | 1 + gcc/testsuite/gcc.target/i386/pr83994.c | 1 + 14 files changed, 14 insertions(+) diff --git a/gcc/testsuite/gcc.target/i386/pr45352-1.c b/gcc/testsuite/gcc.target/i386/pr45352-1.c index 5cd1bd842d8..f5e96b27016 100644 --- a/gcc/testsuite/gcc.target/i386/pr45352-1.c +++ b/gcc/testsuite/gcc.target/i386/pr45352-1.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-mtune=amdfam10 -O3 -fpeel-loops -fselective-scheduling2 -fsel-sched-pipelining -fPIC" } */ static int FIR_Tab_16[16][16]; diff --git a/gcc/testsuite/gcc.target/i386/pr47602.c b/gcc/testsuite/gcc.target/i386/pr47602.c index fa5f5bd7d35..5ed1e1fd490 100644 --- a/gcc/testsuite/gcc.target/i386/pr47602.c +++ b/gcc/testsuite/gcc.target/i386/pr47602.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target ia32 } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-fPIC" } */ /* Test verifies that %ebx is no longer fixed when generating PIC code on i686. */ diff --git a/gcc/testsuite/gcc.target/i386/pr55151.c b/gcc/testsuite/gcc.target/i386/pr55151.c index 62da8cb7781..d6255a83dee 100644 --- a/gcc/testsuite/gcc.target/i386/pr55151.c +++ b/gcc/testsuite/gcc.target/i386/pr55151.c @@ -1,5 +1,6 @@ /* PR rtl-optimization/55151 */ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-fPIC" } */ int a, b, c, d, e, f, g, h, i, j, k, l; diff --git a/gcc/testsuite/gcc.target/i386/pr55458.c b/gcc/testsuite/gcc.target/i386/pr55458.c index 7164ca905db..1dea55c50c9 100644 --- a/gcc/testsuite/gcc.target/i386/pr55458.c +++ b/gcc/testsuite/gcc.target/i386/pr55458.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target ia32 } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-fPIC" } */ /* Test verifies that %ebx is no longer fixed when generating PIC code on i686. */ diff --git a/gcc/testsuite/gcc.target/i386/pr56348.c b/gcc/testsuite/gcc.target/i386/pr56348.c index c31814f60f4..93423d9190d 100644 --- a/gcc/testsuite/gcc.target/i386/pr56348.c +++ b/gcc/testsuite/gcc.target/i386/pr56348.c @@ -1,5 +1,6 @@ /* PR target/56348 */ /* { dg-do compile { target ia32 } } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -fPIC -mfpmath=sse -msse2" } */ typedef unsigned int size_t; diff --git a/gcc/testsuite/gcc.target/i386/pr57097.c b/gcc/testsuite/gcc.target/i386/pr57097.c index 2f0093840df..debacbfc048 100644 --- a/gcc/testsuite/gcc.target/i386/pr57097.c +++ b/gcc/testsuite/gcc.target/i386/pr57097.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -fPIC" } */ extern double ad[], bd[], cd[], dd[]; extern long long all[], bll[], cll[], dll[]; diff --git a/gcc/testsuite/gcc.target/i386/pr65753.c b/gcc/testsuite/gcc.target/i386/pr65753.c index 562f54bff6b..117d6ed0cf1 100644 --- a/gcc/testsuite/gcc.target/i386/pr65753.c +++ b/gcc/testsuite/gcc.target/i386/pr65753.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-fPIC -O2" } */ /* { dg-final { scan-assembler-not "call" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr65915.c b/gcc/testsuite/gcc.target/i386/pr65915.c index 990c5aaa2e4..6588de47c4a 100644 --- a/gcc/testsuite/gcc.target/i386/pr65915.c +++ b/gcc/testsuite/gcc.target/i386/pr65915.c @@ -1,4 +1,5 @@ /* { dg-do run } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -mavx512f -fpic -mcmodel=medium" } */ /* { dg-require-effective-target avx512f } */ /* { dg-require-effective-target lp64 } */ diff --git a/gcc/testsuite/gcc.target/i386/pr66232-5.c b/gcc/testsuite/gcc.target/i386/pr66232-5.c index 87f93802694..76705a52984 100644 --- a/gcc/testsuite/gcc.target/i386/pr66232-5.c +++ b/gcc/testsuite/gcc.target/i386/pr66232-5.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { ! ia32 } } } */ /* { dg-require-effective-target maybe_x32 } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -fpic -mx32" } */ extern void (*bar) (void); diff --git a/gcc/testsuite/gcc.target/i386/pr66334.c b/gcc/testsuite/gcc.target/i386/pr66334.c index 97dfecc8725..19c2396073c 100644 --- a/gcc/testsuite/gcc.target/i386/pr66334.c +++ b/gcc/testsuite/gcc.target/i386/pr66334.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target ia32 } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -fpic -fexceptions -fasynchronous-unwind-tables" } */ /* { dg-final { scan-assembler "movl\[ \\t\].+, %ebx" } } */ extern int foo (int); diff --git a/gcc/testsuite/gcc.target/i386/pr66819-2.c b/gcc/testsuite/gcc.target/i386/pr66819-2.c index 9de4f97a906..ad2a33e7fd2 100644 --- a/gcc/testsuite/gcc.target/i386/pr66819-2.c +++ b/gcc/testsuite/gcc.target/i386/pr66819-2.c @@ -1,4 +1,5 @@ /* { dg-do compile { target ia32 } } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-fPIC -O2 -mregparm=3" } */ /* { dg-final { scan-assembler-not "call" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr67265.c b/gcc/testsuite/gcc.target/i386/pr67265.c index 2671acc043a..1708d537b98 100644 --- a/gcc/testsuite/gcc.target/i386/pr67265.c +++ b/gcc/testsuite/gcc.target/i386/pr67265.c @@ -3,6 +3,7 @@ /* { dg-do compile } */ /* { dg-require-stack-check "" } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-O -fstack-check -fPIC" } */ int a, b, c, d, e; diff --git a/gcc/testsuite/gcc.target/i386/pr81481.c b/gcc/testsuite/gcc.target/i386/pr81481.c index a5b936fdacc..49f7821ea5b 100644 --- a/gcc/testsuite/gcc.target/i386/pr81481.c +++ b/gcc/testsuite/gcc.target/i386/pr81481.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target ssse3 } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -fpic -mssse3" } */ /* { dg-final { scan-assembler-not "pshufb\[ \t\]\\(%esp\\)" } } */ #include diff --git a/gcc/testsuite/gcc.target/i386/pr83994.c b/gcc/testsuite/gcc.target/i386/pr83994.c index dc0b7cb44c4..1eb47e3cf0a 100644 --- a/gcc/testsuite/gcc.target/i386/pr83994.c +++ b/gcc/testsuite/gcc.target/i386/pr83994.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -march=i686 -fpic -fstack-clash-protection" } */ /* { dg-require-effective-target ia32 } */ -- 2.30.2