Commit 1665db4d by Christophe Lyon Committed by Christophe Lyon

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
parent 51115027
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> 2014-10-10 Jakub Jelinek <jakub@redhat.com>
PR c/63495 PR c/63495
......
// PR c++/58678 // PR c++/58678
// { dg-options "-O3 -flto -shared -fPIC -Wl,--no-undefined" } // { dg-options "-O3 -flto -shared -fPIC -Wl,--no-undefined" }
// { dg-do link { target { gld && fpic } } } // { dg-do link { target { { gld && fpic } && shared } } }
struct A { struct A {
virtual ~A(); virtual ~A();
......
...@@ -840,6 +840,19 @@ proc check_effective_target_fpic { } { ...@@ -840,6 +840,19 @@ proc check_effective_target_fpic { } {
return 0 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. # Return 1 if -pie, -fpie and -fPIE are supported, 0 otherwise.
proc check_effective_target_pie { } { proc check_effective_target_pie { } {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment