Message ID | CAKdteOZ-=iM0D_EUgrwg0KNnENaDS_xdndG1c9ub7qMz3UfDzw@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Oct 7, 2014, at 2:54 PM, Christophe Lyon <christophe.lyon@linaro.org> wrote: > When Jason added the new g++.dg/ipa/devirt-28a.C test along with his > fix for PR c++/58678 > (https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00838.html), this new > test was failing in the ARM and AArch64 configuration I am testing. > Is it OK for trunk, and 4.9 (since Jason's patch was also committed to 4.9) ? Ok.
diff --git a/gcc/testsuite/g++.dg/ipa/devirt-28a.C b/gcc/testsuite/g++.dg/ipa/devirt-28a.C index bdd1682..65d5fcd 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-28a.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-28a.C @@ -1,6 +1,6 @@ // PR c++/58678 // { dg-options "-O3 -flto -shared -fPIC -Wl,--no-undefined" } -// { dg-do link { target { gld && fpic } } } +// { dg-do link { target { { gld && fpic } && shared } } } struct A { virtual ~A(); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 77e45cb..7ae6161 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -840,6 +840,19 @@ proc check_effective_target_fpic { } { return 0 } +# Return 1 if -shared is supported, as in no warnings or errors +# emitted, 0 otherwise. + +proc check_effective_target_shared { } { + # Note that M68K has a multilib that supports -fpic but not + # -fPIC, so we need to check both. We test with a program that + # requires GOT references. + return [check_no_compiler_messages shared executable { + extern int foo (void); extern int bar; + int baz (void) { return foo () + bar; } + } "-shared -fpic"] +} + # Return 1 if -pie, -fpie and -fPIE are supported, 0 otherwise. proc check_effective_target_pie { } {