aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/gdb.multi/multi-arch.exp8
-rw-r--r--gdb/testsuite/lib/gdb.exp8
2 files changed, 16 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp
index f2c8a28..e1fbe1b 100644
--- a/gdb/testsuite/gdb.multi/multi-arch.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch.exp
@@ -50,6 +50,14 @@ if [istarget "s390*-*-*"] {
set march2 "-m32"
}
+if { $march1 != "" } {
+ require "have_compile_and_link_flag $march1"
+}
+
+if { $march2 != "" } {
+ require "have_compile_and_link_flag $march2"
+}
+
if { [build_executable "failed to prepare" ${exec1} "${srcfile1}" \
[list debug additional_flags=${march1}]] } {
return -1
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 9d711e8..45588d8 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -9668,6 +9668,14 @@ gdb_caching_proc have_compile_flag { flag } {
additional_flags=$flag]
}
+# Return 1 if we can create an executable using compile and link flag FLAG.
+
+gdb_caching_proc have_compile_and_link_flag { flag } {
+ set src { int main () { return 0; } }
+ return [gdb_can_simple_compile have_compile_and_link_flag_$flag $src executable \
+ additional_flags=$flag]
+}
+
# Handle include file $srcdir/$subdir/FILE.
proc include_file { file } {