+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
// 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();
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 { } {