Message ID | or1q76dlc4.fsf@lxoliva.fsfla.org |
---|---|
State | New |
Headers | show |
Series | [testsuite,i386] require fpic for pr111497.C | expand |
On Tue, Apr 16, 2024 at 5:43 AM Alexandre Oliva <oliva@adacore.com> wrote: > > > Fix another test that uses -fPIC without requiring fpic support. > > Regstrapped on x86_64-linux-gnu. Also tested with gcc-13 on arm-, > aarch64-, x86- and x86_64-vxworks7r2. Ok to install? OK. > PS: This is neither the first nor the last such patch. Maybe the test > harness could detect -fPIC et al in compile options and react > intelligently to them, whether by warning if dg-require-effective-target > fpic is missing, or adding it implicitly. We could have more such > smarts in the testsuite machinery. WDYT? Might be a possibility I guess. There's other options like -fprofile-* which have matching effective targets. > > for gcc/testsuite/ChangeLog > > * g++.target/i386/pr111497.C: Require fpic support. > --- > gcc/testsuite/g++.target/i386/pr111497.C | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/gcc/testsuite/g++.target/i386/pr111497.C b/gcc/testsuite/g++.target/i386/pr111497.C > index a645bb95907ee..30e2e0409ad0e 100644 > --- a/gcc/testsuite/g++.target/i386/pr111497.C > +++ b/gcc/testsuite/g++.target/i386/pr111497.C > @@ -1,5 +1,6 @@ > // { dg-do compile { target ia32 } } > // { dg-options "-march=i686 -mtune=generic -fPIC -O2 -g" } > +// { dg-require-effective-target fpic } > > class A; > struct B { const char *b1; int b2; }; > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > More tolerance and less prejudice are key for inclusion and diversity > Excluding neuro-others for not behaving ""normal"" is *not* inclusive
diff --git a/gcc/testsuite/g++.target/i386/pr111497.C b/gcc/testsuite/g++.target/i386/pr111497.C index a645bb95907ee..30e2e0409ad0e 100644 --- a/gcc/testsuite/g++.target/i386/pr111497.C +++ b/gcc/testsuite/g++.target/i386/pr111497.C @@ -1,5 +1,6 @@ // { dg-do compile { target ia32 } } // { dg-options "-march=i686 -mtune=generic -fPIC -O2 -g" } +// { dg-require-effective-target fpic } class A; struct B { const char *b1; int b2; };