aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite/lib
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-03-09 02:00:58 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-03-09 02:00:58 +0000
commitcea104095654241bf3055ee31e910ceaffae4487 (patch)
treec6419f7d38bf94e7174b34fc6b2a4c92c0f68400 /gas/testsuite/lib
parent4199fe1239b2fdbbf552f85524e0f9dafd61e100 (diff)
downloadgdb-cea104095654241bf3055ee31e910ceaffae4487.zip
gdb-cea104095654241bf3055ee31e910ceaffae4487.tar.gz
gdb-cea104095654241bf3055ee31e910ceaffae4487.tar.bz2
Add tests for PR gas/9966 and PR gas/11356.
2010-03-08 H.J. Lu <hongjiu.lu@intel.com> PR gas/9966 PR gas/11356 * gas/i386/list-1.l: New. * gas/i386/list-1.s: Likewise. * gas/i386/list-2.l: Likewise. * gas/i386/list-2.s: Likewise. * gas/i386/list-3.l: Likewise. * gas/i386/list-3.s: Likewise. * gas/i386/i386.exp: Run list-1, list-2 and list-3. * lib/gas-defs.exp (gas_run_stdin): New. (run_list_test_stdin): Likewise.
Diffstat (limited to 'gas/testsuite/lib')
-rw-r--r--gas/testsuite/lib/gas-defs.exp37
1 files changed, 37 insertions, 0 deletions
diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp
index 06bf04c..0506b94 100644
--- a/gas/testsuite/lib/gas-defs.exp
+++ b/gas/testsuite/lib/gas-defs.exp
@@ -116,6 +116,24 @@ proc gas_run { prog as_opts redir } {
return [list $comp_output ""]
}
+proc gas_run_stdin { prog as_opts redir } {
+ global AS
+ global ASFLAGS
+ global comp_output
+ global srcdir
+ global subdir
+ global host_triplet
+
+ set status [gas_host_run "$AS $ASFLAGS $as_opts < $srcdir/$subdir/$prog" "$redir"]
+ set comp_output [lindex $status 1]
+ if { [lindex $status 0] != 0 && [regexp "2>.*" $redir] } then {
+ append comp_output "child process exited abnormally"
+ }
+ set comp_output [prune_warnings $comp_output]
+ verbose "output was $comp_output"
+ return [list $comp_output ""]
+}
+
proc all_ones { args } {
foreach x $args { if [expr $x!=1] { return 0 } }
return 1
@@ -990,3 +1008,22 @@ proc run_list_test { name {opts {}} {testname {}} } {
}
pass $testname
}
+
+# run_list_test_stdin NAME (optional): OPTS TESTNAME
+#
+# Similar to run_list_test, but use stdin as input.
+
+proc run_list_test_stdin { name {opts {}} {testname {}} } {
+ global srcdir subdir
+ if { [string length $testname] == 0 } then {
+ set testname "[file tail $subdir] $name"
+ }
+ set file $srcdir/$subdir/$name
+ gas_run_stdin ${name}.s $opts ">&dump.out"
+ if { [regexp_diff "dump.out" "${file}.l"] } then {
+ fail $testname
+ verbose "output is [file_contents "dump.out"]" 2
+ return
+ }
+ pass $testname
+}