* gas/d10v/instruction_packing-005.d: Adjust.
authorAlan Modra <amodra@gmail.com>
Mon, 21 Feb 2005 10:07:08 +0000 (10:07 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 21 Feb 2005 10:07:08 +0000 (10:07 +0000)
* 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.

24 files changed:
gas/testsuite/ChangeLog
gas/testsuite/gas/d10v/instruction_packing-005.d
gas/testsuite/gas/d10v/instruction_packing-008.d
gas/testsuite/gas/d10v/instruction_packing-009.d
gas/testsuite/gas/d10v/instruction_packing-010.d
gas/testsuite/gas/d10v/warning-001.d
gas/testsuite/gas/d10v/warning-002.d
gas/testsuite/gas/d10v/warning-003.d
gas/testsuite/gas/d10v/warning-004.d
gas/testsuite/gas/d10v/warning-005.d
gas/testsuite/gas/d10v/warning-006.d
gas/testsuite/gas/d10v/warning-007.d
gas/testsuite/gas/d10v/warning-008.d
gas/testsuite/gas/d10v/warning-009.d
gas/testsuite/gas/d10v/warning-010.d
gas/testsuite/gas/d10v/warning-011.d
gas/testsuite/gas/d10v/warning-012.d
gas/testsuite/gas/d10v/warning-013.d
gas/testsuite/gas/d10v/warning-015.d
gas/testsuite/gas/d10v/warning-016.d
gas/testsuite/gas/d10v/warning-017.d
gas/testsuite/gas/d10v/warning-018.d
gas/testsuite/gas/d10v/warning-019.d
gas/testsuite/lib/gas-defs.exp

index 8e1b1b7..eec0315 100644 (file)
@@ -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,
index 71ed975..0129b71 100644 (file)
@@ -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.
 
index 22db480..1845950 100644 (file)
@@ -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
index 327ea3e..b81df4f 100644 (file)
@@ -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
index aba360e..2275401 100644 (file)
@@ -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
index 5ef473c..1f12042 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-001.s
-#error : cr6 is a reserved control register
+#warning : cr6 is a reserved control register
index c331e69..c62eae6 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-002.s
-#error : cr6 is a reserved control register
+#warning : cr6 is a reserved control register
index 4282e13..e155d56 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-003.s
-#error : cr12 is a reserved control register
+#warning : cr12 is a reserved control register
index 193a843..46f8e2e 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-004.s
-#error : cr12 is a reserved control register
+#warning : cr12 is a reserved control register
index 7759271..4fcae03 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-005.s
-#error : Warning: cr13 is a reserved control register
+#warning : Warning: cr13 is a reserved control register
index 50656fb..e398fd9 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-006.s
-#error : cr13 is a reserved control register
+#warning : cr13 is a reserved control register
index 1ab4879..b5b92e8 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-007.s
-#error : Warning: cr13 is a reserved control register
+#warning : Warning: cr13 is a reserved control register
index 30211ab..911934b 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-008.s
-#error : cr15 is a reserved control register
+#warning : cr15 is a reserved control register
index 695fc77..b11666c 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-009.s
-#error : cr15 is a reserved control register
+#warning : cr15 is a reserved control register
index 44e1e30..d5825c6 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-010.s
-#error : cr4 is a reserved control register
+#warning : cr4 is a reserved control register
index 12a3c04..cf1a54b 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-011.s
-#error : cr4 is a reserved control register
+#warning : cr4 is a reserved control register
index 2e4dcbb..8a17f47 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-012.s
-#error : cr5 is a reserved control register
+#warning : cr5 is a reserved control register
index 8675428..6da2bb3 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-013.s
-#error : cr5 is a reserved control register
+#warning : cr5 is a reserved control register
index ff4a97c..6725d01 100644 (file)
@@ -1,2 +1,2 @@
 #source: instruction_packing-002.s
-#error : Warning: resource conflict \(C flag\)
+#warning : Warning: resource conflict \(C flag\)
index f833369..cd19f0f 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-016.s
-#error : Warning: resource conflict \(F flag\)
+#warning : Warning: resource conflict \(F flag\)
index a8aed68..34134cc 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-017.s
-#error : Warning: resource conflict \(C flag\)
+#warning : Warning: resource conflict \(C flag\)
index 40b1106..5c5e710 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-018.s
-#error : Warning: resource conflict \(C flag\)
+#warning : Warning: resource conflict \(C flag\)
index 6388751..cf05c54 100644 (file)
@@ -1,2 +1,2 @@
 #source: warning-019.s
-#error : Warning: resource conflict \(R0\)
+#warning : Warning: resource conflict \(R0\)
index 9498437..9f93373 100644 (file)
@@ -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