aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.asm
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-06-25 20:11:43 +0000
committerTom Tromey <tromey@redhat.com>2012-06-25 20:11:43 +0000
commite2fc92c6c7761795070751d6fcc381ad1c8fc000 (patch)
tree01173c304f28cbe966cb14d94b869da17ac4aedf /gdb/testsuite/gdb.asm
parentb0963d73503e461769479e7fa2e106d27fe77c05 (diff)
downloadgdb-e2fc92c6c7761795070751d6fcc381ad1c8fc000.zip
gdb-e2fc92c6c7761795070751d6fcc381ad1c8fc000.tar.gz
gdb-e2fc92c6c7761795070751d6fcc381ad1c8fc000.tar.bz2
* gdb.asm/asm-source.exp: Use standard_output_file,
standard_testfile. Construct .o files in proper subdir.
Diffstat (limited to 'gdb/testsuite/gdb.asm')
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp34
1 files changed, 17 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index 9c2435b..db2ae2b 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -27,12 +27,14 @@ set asm-flags ""
set link-flags "-e _start"
set debug-flags ""
+set obj_include -I[standard_output_file {}]
+
switch -glob -- [istarget] {
"alpha*-*-*" {
set asm-arch alpha
# ??? Won't work with ecoff systems like Tru64, but then we also
# don't have any other -g flag that creates mdebug output.
- set asm-flags "-no-mdebug -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-no-mdebug -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
}
"arm*-*-*" {
@@ -72,7 +74,7 @@ switch -glob -- [istarget] {
}
"m6811-*-*" {
set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc11 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-mshort-double -m68hc11 --no-warn -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
# This asm test is specific and uses the linker directly.
# We must not use the target board linker script defined for other
@@ -83,7 +85,7 @@ switch -glob -- [istarget] {
}
"m6812-*-*" {
set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc12 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-mshort-double -m68hc12 --no-warn -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
# This asm test is specific and uses the linker directly.
# We must not use the target board linker script defined for other
@@ -98,11 +100,11 @@ switch -glob -- [istarget] {
"powerpc*-*" {
if { [is_lp64_target] } {
set asm-arch powerpc64
- set asm-flags "-a64 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-a64 -I${srcdir}/${subdir} $obj_include"
append link-flags " -m elf64ppc"
} else {
set asm-arch powerpc
- set asm-flags "-a32 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-a32 -I${srcdir}/${subdir} $obj_include"
append link-flags " -m elf32ppc"
}
}
@@ -115,12 +117,12 @@ switch -glob -- [istarget] {
}
"sparc64-*-*" {
set asm-arch sparc64
- set asm-flags "-xarch=v9 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-xarch=v9 -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
}
"spu*-*-*" {
set asm-arch spu
- set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir} --no-warn"
+ set asm-flags "-I${srcdir}/${subdir} $obj_include --no-warn"
set debug-flags "-gdwarf-2"
}
"xstormy16-*-*" {
@@ -196,10 +198,7 @@ if [board_info $dest exists multilib_flags] {
}
}
-set testfile "asm-source"
-set binfile ${objdir}/${subdir}/${testfile}
-set srcfile1 asmsrc1.s
-set srcfile2 asmsrc2.s
+standard_testfile asmsrc1.s asmsrc2.s
remote_exec build "rm -f ${subdir}/arch.inc"
remote_download host ${srcdir}/${subdir}/${asm-arch}.inc ${subdir}/arch.inc
@@ -207,7 +206,7 @@ remote_exec build "rm -f ${subdir}/note.inc"
remote_download host ${srcdir}/${subdir}/${asm-note}.inc ${subdir}/note.inc
if { [string equal ${asm-flags} ""] } {
- set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-I${srcdir}/${subdir} $obj_include"
}
if { [string equal ${debug-flags} ""] } {
@@ -239,11 +238,14 @@ regsub "--" "-gstabs\[+\]" "${debug-flags}" "-gstabs" debug-flags
# The GNU assembler does not support level options like "-g2" or "-g3".
regsub "--" "-g\[0-9\]" "${debug-flags}" "" debug-flags
-if {[target_assemble ${srcdir}/${subdir}/${srcfile1} asmsrc1.o "${asm-flags} ${debug-flags}"] != ""} then {
+set asm1obj [standard_output_file asmrc1.o]
+set asm2obj [standard_output_file asmrc2.o]
+
+if {[target_assemble ${srcdir}/${subdir}/${srcfile} $asm1obj "${asm-flags} ${debug-flags}"] != ""} then {
untested asm-source.exp
return -1
}
-if {[target_assemble ${srcdir}/${subdir}/${srcfile2} asmsrc2.o "${asm-flags} ${debug-flags}"] != ""} then {
+if {[target_assemble ${srcdir}/${subdir}/${srcfile2} $asm2obj "${asm-flags} ${debug-flags}"] != ""} then {
untested asm-source.exp
return -1
}
@@ -254,7 +256,7 @@ if {[target_assemble ${srcdir}/${subdir}/${srcfile2} asmsrc2.o "${asm-flags} ${d
# code here that provides its own startup code. Using target_link
# also avoids a lot of problems on many systems, most notably on
# *-*-*bsd* and *-*-solaris2*.
-if {[target_link "asmsrc1.o asmsrc2.o" "${binfile}" ${link-flags}] != "" } then {
+if {[target_link [list $asm1obj $asm2obj] "${binfile}" ${link-flags}] != "" } then {
untested asm-source.exp
return -1
}
@@ -264,8 +266,6 @@ if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } {
set_board_info ldscript $old_ldscript
}
-remote_exec build "mv asmsrc1.o asmsrc2.o ${objdir}/${subdir}"
-
# Collect some line numbers.
set line_main [expr [gdb_get_line_number "main start" "asmsrc1.s"] + 1]
set line_call_foo2 [expr [gdb_get_line_number "call foo2" "asmsrc1.s"] + 1]