target-supports.exp (check_effective_target_shared): New function.

2014-10-11  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_shared): New
	function.
        * g++.dg/ipa/devirt-28a.C: Check if -shared is supported.

From-SVN: r216117
This commit is contained in:
Christophe Lyon 2014-10-11 11:33:37 +00:00 committed by Christophe Lyon
parent 5111502753
commit 1665db4dbd
3 changed files with 20 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2014-10-11 Christophe Lyon <christophe.lyon@linaro.org>
* lib/target-supports.exp (check_effective_target_shared): New
function.
* g++.dg/ipa/devirt-28a.C: Check if -shared is supported.
2014-10-10 Jakub Jelinek <jakub@redhat.com>
PR c/63495

View file

@ -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();

View file

@ -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 { } {