Clear hardware capabilities for gcc.dg/vect/vect-simd-clone-*.c
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 6 Jan 2014 13:56:53 +0000 (13:56 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Mon, 6 Jan 2014 13:56:53 +0000 (13:56 +0000)
* gcc.dg/vect/vect.exp: Add clearcap_ldflags to DEFAULT_VECTCFLAGS
if supported.

From-SVN: r206360

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/vect.exp

index 592a822..ab3f2b0 100644 (file)
@@ -1,5 +1,10 @@
 2014-01-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
+       * gcc.dg/vect/vect.exp: Add clearcap_ldflags to DEFAULT_VECTCFLAGS
+       if supported.
+
+2014-01-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
        * gcc.target/i386/avx512f-vcmppd-2.c: Add -std=c99.
        Require c99_runtime.
        * gcc.target/i386/avx512f-vcmpps-2.c: Likewise.
index b0b7e22..fa11e7e 100644 (file)
@@ -41,6 +41,28 @@ if ![check_vect_support_and_set_flags] {
 # These flags are used for all targets.
 lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-vect-cost-model" "-fno-common"
 
+# If the linker used understands -M <mapfile>, pass it to clear hardware
+# capabilities set by the Sun assembler.
+# Try mapfile syntax v2 first which is the only way to clear hwcap_2 flags.
+set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcapv2.map"
+
+if ![check_no_compiler_messages mapfilev2 executable {
+    int main (void) { return 0; }
+} $clearcap_ldflags ] {
+    # If this doesn't work, fall back to the less capable v1 syntax.
+    set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcap.map"
+
+    if ![check_no_compiler_messages mapfile executable {
+       int main (void) { return 0; }
+    } $clearcap_ldflags ] {
+       unset clearcap_ldflags
+    }
+}
+
+if [info exists clearcap_ldflags] {
+    lappend DEFAULT_VECTCFLAGS $clearcap_ldflags
+}
+
 # Initialize `dg'.
 dg-init