aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-02-21 10:07:08 +0000
committerAlan Modra <amodra@gmail.com>2005-02-21 10:07:08 +0000
commitba7f26d2f9340029fb0dbfa944214be28667a3b3 (patch)
treef3a3e123b114fca17fb424393b2c33ad174eca38 /gas/testsuite
parentcc1bc22af7e433b5cfca0907e069ffbeb8a29660 (diff)
downloadfsf-binutils-gdb-ba7f26d2f9340029fb0dbfa944214be28667a3b3.zip
fsf-binutils-gdb-ba7f26d2f9340029fb0dbfa944214be28667a3b3.tar.gz
fsf-binutils-gdb-ba7f26d2f9340029fb0dbfa944214be28667a3b3.tar.bz2
* gas/d10v/instruction_packing-005.d: Adjust.
* gas/d10v/instruction_packing-008.d: Ignore disassembled stabs. * gas/d10v/instruction_packing-009.d: Likewise. * gas/d10v/instruction_packing-010.d: Likewise. * gas/d10v/warning-001.d: Use #warning instead of #error. * gas/d10v/warning-002.d: Likewise. * gas/d10v/warning-003.d: Likewise. * gas/d10v/warning-004.d: Likewise. * gas/d10v/warning-005.d: Likewise. * gas/d10v/warning-006.d: Likewise. * gas/d10v/warning-007.d: Likewise. * gas/d10v/warning-008.d: Likewise. * gas/d10v/warning-009.d: Likewise. * gas/d10v/warning-010.d: Likewise. * gas/d10v/warning-011.d: Likewise. * gas/d10v/warning-012.d: Likewise. * gas/d10v/warning-013.d: Likewise. * gas/d10v/warning-015.d: Likewise. * gas/d10v/warning-016.d: Likewise. * gas/d10v/warning-017.d: Likewise. * gas/d10v/warning-018.d: Likewise. * gas/d10v/warning-019.d: Likewise. * lib/gas-defs.exp (run_dump_test): Don't require a dump program if #warning given. Rearrange to allow $program to remain unset. Fail the test if warning not found when expected. Conversely fail the test if assembler errors or warnings given when not expected.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog29
-rw-r--r--gas/testsuite/gas/d10v/instruction_packing-005.d2
-rw-r--r--gas/testsuite/gas/d10v/instruction_packing-008.d1
-rw-r--r--gas/testsuite/gas/d10v/instruction_packing-009.d1
-rw-r--r--gas/testsuite/gas/d10v/instruction_packing-010.d1
-rw-r--r--gas/testsuite/gas/d10v/warning-001.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-002.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-003.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-004.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-005.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-006.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-007.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-008.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-009.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-010.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-011.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-012.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-013.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-015.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-016.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-017.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-018.d2
-rw-r--r--gas/testsuite/gas/d10v/warning-019.d2
-rw-r--r--gas/testsuite/lib/gas-defs.exp107
24 files changed, 104 insertions, 73 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 8e1b1b7..eec0315a 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,32 @@
+2005-02-21 Alan Modra <amodra@bigpond.net.au>
+
+ * gas/d10v/instruction_packing-005.d: Adjust.
+ * gas/d10v/instruction_packing-008.d: Ignore disassembled stabs.
+ * gas/d10v/instruction_packing-009.d: Likewise.
+ * gas/d10v/instruction_packing-010.d: Likewise.
+ * gas/d10v/warning-001.d: Use #warning instead of #error.
+ * gas/d10v/warning-002.d: Likewise.
+ * gas/d10v/warning-003.d: Likewise.
+ * gas/d10v/warning-004.d: Likewise.
+ * gas/d10v/warning-005.d: Likewise.
+ * gas/d10v/warning-006.d: Likewise.
+ * gas/d10v/warning-007.d: Likewise.
+ * gas/d10v/warning-008.d: Likewise.
+ * gas/d10v/warning-009.d: Likewise.
+ * gas/d10v/warning-010.d: Likewise.
+ * gas/d10v/warning-011.d: Likewise.
+ * gas/d10v/warning-012.d: Likewise.
+ * gas/d10v/warning-013.d: Likewise.
+ * gas/d10v/warning-015.d: Likewise.
+ * gas/d10v/warning-016.d: Likewise.
+ * gas/d10v/warning-017.d: Likewise.
+ * gas/d10v/warning-018.d: Likewise.
+ * gas/d10v/warning-019.d: Likewise.
+ * lib/gas-defs.exp (run_dump_test): Don't require a dump program if
+ #warning given. Rearrange to allow $program to remain unset.
+ Fail the test if warning not found when expected. Conversely fail
+ the test if assembler errors or warnings given when not expected.
+
2005-02-18 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* gas/mips/noat-1.s, gas/mips/noat-1.d, gas/mips/noat-2.s,
diff --git a/gas/testsuite/gas/d10v/instruction_packing-005.d b/gas/testsuite/gas/d10v/instruction_packing-005.d
index 71ed975..0129b71 100644
--- a/gas/testsuite/gas/d10v/instruction_packing-005.d
+++ b/gas/testsuite/gas/d10v/instruction_packing-005.d
@@ -25,5 +25,5 @@ Disassembly of section .text:
Disassembly of section .data:
00000000 <in_data>:
- 0: Address 0x0 is out of bounds.
+ 0: Address 0x0+ is out of bounds.
diff --git a/gas/testsuite/gas/d10v/instruction_packing-008.d b/gas/testsuite/gas/d10v/instruction_packing-008.d
index 22db480..1845950 100644
--- a/gas/testsuite/gas/d10v/instruction_packing-008.d
+++ b/gas/testsuite/gas/d10v/instruction_packing-008.d
@@ -12,3 +12,4 @@ Disassembly of section .text:
8: 60 22 c0 67 ldi.s r2, 0x2 -> ldi.s r3, 0x3
c: e0 40 40 00 ldi.l r4, 0x4000
10: 60 55 cc 1a ldi.s r5, 0x5 -> jmp r13
+#pass
diff --git a/gas/testsuite/gas/d10v/instruction_packing-009.d b/gas/testsuite/gas/d10v/instruction_packing-009.d
index 327ea3e..b81df4f 100644
--- a/gas/testsuite/gas/d10v/instruction_packing-009.d
+++ b/gas/testsuite/gas/d10v/instruction_packing-009.d
@@ -14,3 +14,4 @@ Disassembly of section .text:
10: e0 40 40 00 ldi.l r4, 0x4000
14: 20 55 de 00 ldi.s r5, 0x5 || nop
18: 26 0d 5e 00 jmp r13 || nop
+#pass
diff --git a/gas/testsuite/gas/d10v/instruction_packing-010.d b/gas/testsuite/gas/d10v/instruction_packing-010.d
index aba360e..2275401 100644
--- a/gas/testsuite/gas/d10v/instruction_packing-010.d
+++ b/gas/testsuite/gas/d10v/instruction_packing-010.d
@@ -12,3 +12,4 @@ Disassembly of section .text:
8: 60 22 c0 67 ldi.s r2, 0x2 -> ldi.s r3, 0x3
c: e0 40 40 00 ldi.l r4, 0x4000
10: 60 55 cc 1a ldi.s r5, 0x5 -> jmp r13
+#pass
diff --git a/gas/testsuite/gas/d10v/warning-001.d b/gas/testsuite/gas/d10v/warning-001.d
index 5ef473c..1f12042 100644
--- a/gas/testsuite/gas/d10v/warning-001.d
+++ b/gas/testsuite/gas/d10v/warning-001.d
@@ -1,2 +1,2 @@
#source: warning-001.s
-#error : cr6 is a reserved control register
+#warning : cr6 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-002.d b/gas/testsuite/gas/d10v/warning-002.d
index c331e69..c62eae6 100644
--- a/gas/testsuite/gas/d10v/warning-002.d
+++ b/gas/testsuite/gas/d10v/warning-002.d
@@ -1,2 +1,2 @@
#source: warning-002.s
-#error : cr6 is a reserved control register
+#warning : cr6 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-003.d b/gas/testsuite/gas/d10v/warning-003.d
index 4282e13..e155d56 100644
--- a/gas/testsuite/gas/d10v/warning-003.d
+++ b/gas/testsuite/gas/d10v/warning-003.d
@@ -1,2 +1,2 @@
#source: warning-003.s
-#error : cr12 is a reserved control register
+#warning : cr12 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-004.d b/gas/testsuite/gas/d10v/warning-004.d
index 193a843..46f8e2e 100644
--- a/gas/testsuite/gas/d10v/warning-004.d
+++ b/gas/testsuite/gas/d10v/warning-004.d
@@ -1,2 +1,2 @@
#source: warning-004.s
-#error : cr12 is a reserved control register
+#warning : cr12 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-005.d b/gas/testsuite/gas/d10v/warning-005.d
index 7759271..4fcae03 100644
--- a/gas/testsuite/gas/d10v/warning-005.d
+++ b/gas/testsuite/gas/d10v/warning-005.d
@@ -1,2 +1,2 @@
#source: warning-005.s
-#error : Warning: cr13 is a reserved control register
+#warning : Warning: cr13 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-006.d b/gas/testsuite/gas/d10v/warning-006.d
index 50656fb..e398fd9 100644
--- a/gas/testsuite/gas/d10v/warning-006.d
+++ b/gas/testsuite/gas/d10v/warning-006.d
@@ -1,2 +1,2 @@
#source: warning-006.s
-#error : cr13 is a reserved control register
+#warning : cr13 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-007.d b/gas/testsuite/gas/d10v/warning-007.d
index 1ab4879..b5b92e8 100644
--- a/gas/testsuite/gas/d10v/warning-007.d
+++ b/gas/testsuite/gas/d10v/warning-007.d
@@ -1,2 +1,2 @@
#source: warning-007.s
-#error : Warning: cr13 is a reserved control register
+#warning : Warning: cr13 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-008.d b/gas/testsuite/gas/d10v/warning-008.d
index 30211ab..911934b 100644
--- a/gas/testsuite/gas/d10v/warning-008.d
+++ b/gas/testsuite/gas/d10v/warning-008.d
@@ -1,2 +1,2 @@
#source: warning-008.s
-#error : cr15 is a reserved control register
+#warning : cr15 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-009.d b/gas/testsuite/gas/d10v/warning-009.d
index 695fc77..b11666c 100644
--- a/gas/testsuite/gas/d10v/warning-009.d
+++ b/gas/testsuite/gas/d10v/warning-009.d
@@ -1,2 +1,2 @@
#source: warning-009.s
-#error : cr15 is a reserved control register
+#warning : cr15 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-010.d b/gas/testsuite/gas/d10v/warning-010.d
index 44e1e30..d5825c6 100644
--- a/gas/testsuite/gas/d10v/warning-010.d
+++ b/gas/testsuite/gas/d10v/warning-010.d
@@ -1,2 +1,2 @@
#source: warning-010.s
-#error : cr4 is a reserved control register
+#warning : cr4 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-011.d b/gas/testsuite/gas/d10v/warning-011.d
index 12a3c04..cf1a54b 100644
--- a/gas/testsuite/gas/d10v/warning-011.d
+++ b/gas/testsuite/gas/d10v/warning-011.d
@@ -1,2 +1,2 @@
#source: warning-011.s
-#error : cr4 is a reserved control register
+#warning : cr4 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-012.d b/gas/testsuite/gas/d10v/warning-012.d
index 2e4dcbb..8a17f47 100644
--- a/gas/testsuite/gas/d10v/warning-012.d
+++ b/gas/testsuite/gas/d10v/warning-012.d
@@ -1,2 +1,2 @@
#source: warning-012.s
-#error : cr5 is a reserved control register
+#warning : cr5 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-013.d b/gas/testsuite/gas/d10v/warning-013.d
index 8675428..6da2bb3 100644
--- a/gas/testsuite/gas/d10v/warning-013.d
+++ b/gas/testsuite/gas/d10v/warning-013.d
@@ -1,2 +1,2 @@
#source: warning-013.s
-#error : cr5 is a reserved control register
+#warning : cr5 is a reserved control register
diff --git a/gas/testsuite/gas/d10v/warning-015.d b/gas/testsuite/gas/d10v/warning-015.d
index ff4a97c..6725d01 100644
--- a/gas/testsuite/gas/d10v/warning-015.d
+++ b/gas/testsuite/gas/d10v/warning-015.d
@@ -1,2 +1,2 @@
#source: instruction_packing-002.s
-#error : Warning: resource conflict \(C flag\)
+#warning : Warning: resource conflict \(C flag\)
diff --git a/gas/testsuite/gas/d10v/warning-016.d b/gas/testsuite/gas/d10v/warning-016.d
index f833369..cd19f0f 100644
--- a/gas/testsuite/gas/d10v/warning-016.d
+++ b/gas/testsuite/gas/d10v/warning-016.d
@@ -1,2 +1,2 @@
#source: warning-016.s
-#error : Warning: resource conflict \(F flag\)
+#warning : Warning: resource conflict \(F flag\)
diff --git a/gas/testsuite/gas/d10v/warning-017.d b/gas/testsuite/gas/d10v/warning-017.d
index a8aed68..34134cc 100644
--- a/gas/testsuite/gas/d10v/warning-017.d
+++ b/gas/testsuite/gas/d10v/warning-017.d
@@ -1,2 +1,2 @@
#source: warning-017.s
-#error : Warning: resource conflict \(C flag\)
+#warning : Warning: resource conflict \(C flag\)
diff --git a/gas/testsuite/gas/d10v/warning-018.d b/gas/testsuite/gas/d10v/warning-018.d
index 40b1106..5c5e710 100644
--- a/gas/testsuite/gas/d10v/warning-018.d
+++ b/gas/testsuite/gas/d10v/warning-018.d
@@ -1,2 +1,2 @@
#source: warning-018.s
-#error : Warning: resource conflict \(C flag\)
+#warning : Warning: resource conflict \(C flag\)
diff --git a/gas/testsuite/gas/d10v/warning-019.d b/gas/testsuite/gas/d10v/warning-019.d
index 6388751..cf05c54 100644
--- a/gas/testsuite/gas/d10v/warning-019.d
+++ b/gas/testsuite/gas/d10v/warning-019.d
@@ -1,2 +1,2 @@
#source: warning-019.s
-#error : Warning: resource conflict \(R0\)
+#warning : Warning: resource conflict \(R0\)
diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp
index 9498437..9f93373 100644
--- a/gas/testsuite/lib/gas-defs.exp
+++ b/gas/testsuite/lib/gas-defs.exp
@@ -1,5 +1,5 @@
-# Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+# 2004, 2005 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
@@ -371,59 +371,48 @@ proc run_dump_test { name {extra_options {}} } {
append opts($opt_name) $opt_val
}
- if {$opts(PROG) != ""} {
- switch -- $opts(PROG) {
- objdump
- { set program objdump }
- nm
- { set program nm }
- objcopy
- { set program objcopy }
- readelf
- { set program readelf }
- default
- { perror "unrecognized program option $opts(PROG) in $file.d"
- unresolved $subdir/$name
- return }
- }
- } elseif { $opts(error) != "" } {
- # It's meaningless to require an output-testing method when we
- # expect an error. For simplicity, we fake an arbitrary method.
- set program "nm"
- } else {
- # Guess which program to run, by seeing which option was specified.
- set program ""
- foreach p {objdump objcopy nm readelf} {
- if {$opts($p) != ""} {
- if {$program != ""} {
- perror "ambiguous dump program in $file.d"
+ if { (($opts(warning) != "") && ($opts(error) != "")) \
+ || (($opts(warning) != "") && ($opts(stderr) != "")) } {
+ perror "$testname: bad mix of stderr, error and warning test-directives"
+ return
+ }
+
+ set program ""
+ # It's meaningless to require an output-testing method when we
+ # expect an error.
+ if { $opts(error) == "" } {
+ if {$opts(PROG) != ""} {
+ switch -- $opts(PROG) {
+ objdump { set program objdump }
+ nm { set program nm }
+ objcopy { set program objcopy }
+ readelf { set program readelf }
+ default {
+ perror "unrecognized program option $opts(PROG) in $file.d"
unresolved $subdir/$name
- return
- } else {
- set program $p
+ return }
+ }
+ } else {
+ # Guess which program to run, by seeing which option was specified.
+ foreach p {objdump objcopy nm readelf} {
+ if {$opts($p) != ""} {
+ if {$program != ""} {
+ perror "ambiguous dump program in $file.d"
+ unresolved $subdir/$name
+ return
+ } else {
+ set program $p
+ }
}
}
}
- if {$program == ""} {
+ if { $program == "" && $opts(warning) == "" } {
perror "dump program unspecified in $file.d"
unresolved $subdir/$name
return
}
}
- set expmsg $opts(error)
- if { $opts(warning) != "" } {
- set expmsg $opts(warning)
- }
- if { (($opts(warning) != "") && ($opts(error) != "")) \
- || (($opts(warning) != "") && ($opts(stderr) != "")) } {
- perror "$testname: bad mix of stderr, error and warning test-directives"
- return
- }
-
- set progopts1 $opts($program)
- eval set progopts \$[string toupper $program]FLAGS
- eval set binary \$[string toupper $program]
if { $opts(name) == "" } {
set testname "$subdir/$name"
} else {
@@ -441,7 +430,11 @@ proc run_dump_test { name {extra_options {}} } {
set cmdret [catch "exec $cmd" comp_output]
set comp_output [prune_warnings $comp_output]
- if { $cmdret != 0 || $comp_output != "" || $opts(stderr) != "" } then {
+ set expmsg $opts(error)
+ if { $opts(warning) != "" } {
+ set expmsg $opts(warning)
+ }
+ if { $cmdret != 0 || $comp_output != "" || $expmsg != "" } then {
# If the executed program writes to stderr and stderr is not
# redirected, exec *always* returns failure, regardless of the
# program exit code. Thankfully, we can retrieve the true
@@ -460,18 +453,17 @@ proc run_dump_test { name {extra_options {}} } {
send_log "$comp_output\n"
verbose "$comp_output" 3
- if { $expmsg != "" \
- && [regexp $expmsg $comp_output] \
+ if { [regexp $expmsg $comp_output] \
&& (($cmdret == 0) == ($opts(warning) != "")) } {
- verbose -log "$exitstat with: <$comp_output>, expected: <$expmsg>"
-
- # Only "pass" and return here if we expected (and got)
- # an error.
- if { $opts(error) != "" } {
+ # We have the expected output from gas.
+ # Return if there's nothing more to do.
+ if { $opts(error) != "" || $program == "" } {
pass $testname
return
}
- } {
+ } else {
+ verbose -log "$exitstat with: <$comp_output>, expected: <$expmsg>"
+
fail $testname
return
}
@@ -503,6 +495,13 @@ proc run_dump_test { name {extra_options {}} } {
}
}
+ if { $program == "" } {
+ return
+ }
+ set progopts1 $opts($program)
+ eval set progopts \$[string toupper $program]FLAGS
+ eval set binary \$[string toupper $program]
+
if { [which $binary] == 0 } {
untested $testname
return