From: Alan Modra Date: Mon, 21 Feb 2005 10:07:08 +0000 (+0000) Subject: * gas/d10v/instruction_packing-005.d: Adjust. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba7f26d2f9340029fb0dbfa944214be28667a3b3;p=binutils-gdb.git * 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. --- diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 8e1b1b702ce..eec0315afcf 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,32 @@ +2005-02-21 Alan Modra + + * 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 * 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 71ed975fc9d..0129b7140aa 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 : - 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 22db4809d2e..1845950fdb7 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 327ea3e5da4..b81df4f1b9e 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 aba360e607f..227540191e3 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 5ef473c36e2..1f120426edf 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 c331e691515..c62eae69b6e 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 4282e13b0de..e155d561b1d 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 193a843277e..46f8e2eb8a1 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 77592712a2c..4fcae03d9ac 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 50656fb797c..e398fd97b64 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 1ab4879dd23..b5b92e88b59 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 30211ab2977..911934b9580 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 695fc77b9ca..b11666ca6b3 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 44e1e30e515..d5825c671e4 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 12a3c04bcd1..cf1a54b59a0 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 2e4dcbb8feb..8a17f47a022 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 86754289f43..6da2bb3d603 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 ff4a97ca994..6725d012b71 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 f833369cc32..cd19f0fb5b1 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 a8aed683c21..34134cc9719 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 40b1106182e..5c5e7108cae 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 63887518877..cf05c54e89d 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 9498437f750..9f933734bb9 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