Index: gdb/testsuite/gdb.base/overlays.exp |
diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp |
index a0176616285144991ce1d2ce13684e4dd87b7600..13d2463b5eb7a77f4c89096279c90cf6676bc339 100644 |
--- a/gdb/testsuite/gdb.base/overlays.exp |
+++ b/gdb/testsuite/gdb.base/overlays.exp |
@@ -1,5 +1,4 @@ |
-# Copyright 1997-1998, 2001-2004, 2007-2012 Free Software Foundation, |
-# Inc. |
+# Copyright 1997-2013 Free Software Foundation, Inc. |
# |
# This program is free software; you can redistribute it and/or modify |
# it under the terms of the GNU General Public License as published by |
@@ -24,11 +23,11 @@ |
set data_overlays 1 |
if [istarget "d10v-*-*"] then { |
- set linker_script "${srcdir}/${subdir}/d10v.ld"; |
+ set linker_script "${srcdir}/${subdir}/d10v.ld" |
} elseif [istarget "m32r-*-*"] then { |
- set linker_script "${srcdir}/${subdir}/m32r.ld"; |
+ set linker_script "${srcdir}/${subdir}/m32r.ld" |
} elseif [istarget "spu-*-*"] then { |
- set linker_script "${srcdir}/${subdir}/spu.ld"; |
+ set linker_script "${srcdir}/${subdir}/spu.ld" |
set data_overlays 0 |
} else { |
verbose "Skipping overlay test -- not implemented for this target." |
@@ -40,36 +39,11 @@ if [istarget "*-*-linux*"] then { |
return |
} |
-set testfile "overlays" |
-set binfile ${objdir}/${subdir}/${testfile} |
-set srcfile ${testfile}.c |
+standard_testfile overlays.c ovlymgr.c foo.c bar.c baz.c grbx.c |
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {debug}] != ""} then { |
- untested overlays.exp |
- return -1 |
-} |
-if {[gdb_compile "${srcdir}/${subdir}/ovlymgr.c" ovlymgr.o object {debug}] != ""} then { |
- untested overlays.exp |
- return -1 |
-} |
-if {[gdb_compile "${srcdir}/${subdir}/foo.c" foo.o object {debug} ] != ""} then { |
- untested overlays.exp |
- return -1 |
-} |
- |
-if {[gdb_compile "${srcdir}/${subdir}/bar.c" bar.o object {debug}] != ""} then { |
- untested overlays.exp |
- return -1 |
-} |
-if {[gdb_compile "${srcdir}/${subdir}/baz.c" baz.o object {debug}] != ""} then { |
- untested overlays.exp |
- return -1 |
-} |
-if {[gdb_compile "${srcdir}/${subdir}/grbx.c" grbx.o object {debug}] != ""} then { |
- untested overlays.exp |
- return -1 |
-} |
-if {[gdb_compile "${testfile}.o ovlymgr.o foo.o bar.o baz.o grbx.o" ${binfile} executable "ldscript=-Wl,-T$linker_script"] != "" } { |
+if {[build_executable $testfile.exp $testfile \ |
+ [list $srcfile $srcfile2 $srcfile3 $srcfile4 $srcfile5 $srcfile6] \ |
+ {debug ldscript=-Wl,-T$linker_script}] == -1} { |
untested overlays.exp |
return -1 |
} |
@@ -86,7 +60,7 @@ gdb_load ${binfile} |
# |
if ![runto_main] then { |
- gdb_suppress_tests; |
+ gdb_suppress_tests |
} |
# couple of convenience variables |