]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/testsuite/ld-pie/pie.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-pie / pie.exp
index aaac4504630f3daf5fd12e48bac33045434702d8..eaf761ac56e8e61a7f0ecb9b13d6df28c4ff0d33 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for various PIE tests.
-#   Copyright (C) 2006-2017 Free Software Foundation, Inc.
+#   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
 # MA 02110-1301, USA.
 #
 
-# This test can only be run if ld generates native executables.
-if ![isnative] then {return}
-
 if { ![istarget *-*-linux*]
      && ![istarget *-*-nacl*]
      && ![istarget *-*-gnu*] } {
     return
 }
 
+# Check to see if the C compiler works
+if { ![check_compiler_available] } {
+    return
+}
+
 # Check if -pie is supported or not.
 send_log "$CC -fpie -pie $srcdir/$subdir/pie.c -o tmpdir/pie"
 catch "exec $CC -fpie -pie $srcdir/$subdir/pie.c -o tmpdir/pie" exec_output
@@ -37,8 +39,10 @@ if { ![string match "" $exec_output] } {
 }
 
 set array_tests {
-    {"weak undefined" "-pie" "" {weakundef.c} "weakundef" "weakundef.out" "-fPIC"}
-    {"weak undefined data" "-pie" "" {weakundef-data.c} "weakundef-data" "weakundef.out" "-fPIC"}
+    {"weak undefined" "-pie" ""
+       {weakundef.c} "weakundef" "weakundef.out" "-fPIC"}
+    {"weak undefined data" "-pie" ""
+       {weakundef-data.c} "weakundef-data" "weakundef.out" "-fPIC"}
 }
 
 run_ld_link_exec_tests $array_tests