2005-07-04 Zack Weinberg <zack@codesourcery.com>
authorPaul Brook <paul@codesourcery.com>
Mon, 4 Jul 2005 14:58:52 +0000 (14:58 +0000)
committerPaul Brook <paul@codesourcery.com>
Mon, 4 Jul 2005 14:58:52 +0000 (14:58 +0000)
* lib/gas-defs.exp (run_dump_tests): New proc.
(run_dump_test): Add support for new options: target, not-target,
skip, not-skip, error-output.  Document stderr.  Tidy a
little.
(slurp_options): If a line doesn't match the option regexp, but
does begin with #, ignore it; don't stop parsing options.
* gas/arm/arm.exp: Remove most code.  Use run_dump_tests.

* gas/arm/archv6t2-bad.d, gas/arm/armv1.d, gas/arm/iwmmxt-bad.d
* gas/arm/r15-bad.d, gas/arm/req.d, gas/arm/t16-bad.d
* gas/arm/undefined.d, gas/arm/undefined_coff.d, gas/arm/vfp-bad.d:
New files.
* gas/arm/bignum1.d, gas/arm/mapping.d, gas/arm/pic.d:
Only run on ELF targets.
* gas/arm/tls.d, gas/arm/unwind.d: Only run on ELF targets.
Skip on VxWorks.
* gas/arm/tls_vxworks.d, gas/arm/unwind_vxworks.d: New files.
* gas/arm/thumb.d, gas/arm/thumb32.d: Don't run on aout or pe.
* gas/arm/le-fpconst.d: Only run on *-*-pe.
* gas/arm/inst.d: Skip on WinCE.
* gas/arm/wince_inst.d: Skip unless WinCE.
* gas/arm/el_segundo.d: Mark up for actual use; adjust
expectations.
* gas/arm/el_segundo.s: Remove irrelevant junk.  Add padding
for a.out's sake.

26 files changed:
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/archv6t2-bad.d [new file with mode: 0644]
gas/testsuite/gas/arm/arm.exp
gas/testsuite/gas/arm/armv1-bad.d [new file with mode: 0644]
gas/testsuite/gas/arm/bignum1.d
gas/testsuite/gas/arm/el_segundo.d
gas/testsuite/gas/arm/el_segundo.s
gas/testsuite/gas/arm/inst.d
gas/testsuite/gas/arm/iwmmxt-bad.d [new file with mode: 0644]
gas/testsuite/gas/arm/le-fpconst.d
gas/testsuite/gas/arm/mapping.d
gas/testsuite/gas/arm/pic.d
gas/testsuite/gas/arm/r15-bad.d [new file with mode: 0644]
gas/testsuite/gas/arm/req.d [new file with mode: 0644]
gas/testsuite/gas/arm/t16-bad.d [new file with mode: 0644]
gas/testsuite/gas/arm/thumb.d
gas/testsuite/gas/arm/thumb32.d
gas/testsuite/gas/arm/tls.d
gas/testsuite/gas/arm/tls_vxworks.d [new file with mode: 0644]
gas/testsuite/gas/arm/undefined.d [new file with mode: 0644]
gas/testsuite/gas/arm/undefined_coff.d [new file with mode: 0644]
gas/testsuite/gas/arm/unwind.d
gas/testsuite/gas/arm/unwind_vxworks.d [new file with mode: 0644]
gas/testsuite/gas/arm/vfp-bad.d [new file with mode: 0644]
gas/testsuite/gas/arm/wince_inst.d
gas/testsuite/lib/gas-defs.exp

index 352f34a..05f1610 100644 (file)
@@ -1,3 +1,31 @@
+2005-07-04  Zack Weinberg  <zack@codesourcery.com>
+
+       * lib/gas-defs.exp (run_dump_tests): New proc.
+       (run_dump_test): Add support for new options: target, not-target,
+       skip, not-skip, error-output.  Document stderr.  Tidy a
+       little.
+       (slurp_options): If a line doesn't match the option regexp, but
+       does begin with #, ignore it; don't stop parsing options.
+       * gas/arm/arm.exp: Remove most code.  Use run_dump_tests.
+
+       * gas/arm/archv6t2-bad.d, gas/arm/armv1.d, gas/arm/iwmmxt-bad.d
+       * gas/arm/r15-bad.d, gas/arm/req.d, gas/arm/t16-bad.d
+       * gas/arm/undefined.d, gas/arm/undefined_coff.d, gas/arm/vfp-bad.d:
+       New files.
+       * gas/arm/bignum1.d, gas/arm/mapping.d, gas/arm/pic.d:
+       Only run on ELF targets.
+       * gas/arm/tls.d, gas/arm/unwind.d: Only run on ELF targets.
+       Skip on VxWorks.
+       * gas/arm/tls_vxworks.d, gas/arm/unwind_vxworks.d: New files.
+       * gas/arm/thumb.d, gas/arm/thumb32.d: Don't run on aout or pe.
+       * gas/arm/le-fpconst.d: Only run on *-*-pe.
+       * gas/arm/inst.d: Skip on WinCE.
+       * gas/arm/wince_inst.d: Skip unless WinCE.
+       * gas/arm/el_segundo.d: Mark up for actual use; adjust
+       expectations.
+       * gas/arm/el_segundo.s: Remove irrelevant junk.  Add padding
+       for a.out's sake.
+
 2005-07-01  Jan Beulich  <jbeulich@novell.com>
 
        * gas/ia64/group-2.s: Use register as second operand of .prologue.
diff --git a/gas/testsuite/gas/arm/archv6t2-bad.d b/gas/testsuite/gas/arm/archv6t2-bad.d
new file mode 100644 (file)
index 0000000..9b8e1b9
--- /dev/null
@@ -0,0 +1,3 @@
+#name: Invalid V6T2 instructions
+#as: -march=armv6t2
+#error-output: archv6t2-bad.l
index 123b813..56aef3b 100644 (file)
@@ -1,91 +1,7 @@
 #
 # Some ARM tests
 #
-proc run_errors_test { name opts tname} {
-    global srcdir subdir
-    set testname "$tname"
-    set file $srcdir/$subdir/$name
-    gas_run ${name}.s $opts ">&${name}.out"
-    if { [regexp_diff "${name}.out" "${file}.l"] } then {
-        fail $testname
-        verbose "output is [file_contents "${name}.out"]" 2
-        return
-    }
-    pass $testname
-}
-
-if {[istarget *arm*-*-*] || [istarget "xscale-*-*"]} then {
-
-    if {[istarget *-wince-*]} then {
-       run_dump_test "wince_inst"
-    } else {
-       run_dump_test "inst"
-    }
-
-    run_dump_test "ldconst"
-    run_dump_test "arm7t"
-    run_dump_test "copro"
-    run_dump_test "arm3"
-    run_dump_test "arm6"
-    run_dump_test "arm7dm"
-    run_dump_test "arch4t"
-    run_dump_test "immed"
-    run_dump_test "float"
-    run_dump_test "offset"
-    run_dump_test "armv1"
-    run_dump_test "arch5tej"
-    run_dump_test "fpa-monadic"
-    run_dump_test "fpa-dyadic"
-    run_dump_test "fpa-mem"
-    run_dump_test "vfp1xD"
-    run_dump_test "vfp1"
-    run_dump_test "vfp2"
-    run_dump_test "xscale"
-    run_dump_test "adrl"
-    run_dump_test "reg-alias"
-    run_dump_test "maverick"    
-    run_dump_test "archv6"
-    run_dump_test "archv6t2"
-    run_dump_test "thumbv6"
-    run_dump_test "thumbv6k"
-    run_dump_test "arch6zk"
-    run_dump_test "tcompat"
-    run_dump_test "tcompat2"
-    run_dump_test "iwmmxt"
-    run_dump_test "macro1"
-    
-    run_errors_test "vfp-bad" "-mfpu=vfp" "VFP errors"
-    run_errors_test "req" "-mcpu=arm7m" ".req errors"
-    run_errors_test "armv1-bad" "-mcpu=arm7m" "ARM v1 errors"
-    run_errors_test "r15-bad" "" "Invalid use of r15 errors"
-    run_errors_test "archv6t2-bad" "-march=armv6t2" "Invalid V6T2 instructions"
-    run_errors_test "t16-bad" "-march=armv6k" "Valid ARM, invalid Thumb"
-    run_errors_test "iwmmxt-bad" "-mcpu=iwmmxt" "iWMMXt errors"
-
-    if {[istarget *-*-*coff] || [istarget *-*-pe] || [istarget *-*-wince] ||
-        [istarget *-*-*aout*] || [istarget *-*-netbsd] || [istarget *-*-riscix*]} then {
-       # COFF and aout based ports use a different naming convention for local labels.
-       run_errors_test "undefined_coff" "" "Undefined local label error"
-   } else {
-       # For ELF based ports we can run some additional tests as well.
-        run_errors_test "undefined" "" "Undefined local label error"
-       
-       run_dump_test "pic"
-       run_dump_test "mapping"
-       run_dump_test "bignum1"
-       run_dump_test "unwind"
-       run_dump_test "tls"
-    }
-
-    # The arm-aout port does not support Thumb branch relocations.
-    if {! [istarget arm*-*-aout] && ![istarget arm-*-pe]} then {
-       run_dump_test "thumb"
-       run_dump_test "thumb32"
-    }
 
-    # Not all arm targets are bi-endian, so only run this test on ones
-    # we know that are.  FIXME: We should probably also key off armeb/armel.
-    if [istarget *-*-pe] {
-       run_dump_test "le-fpconst"
-    }
+if {[istarget *arm*-*-*] || [istarget *xscale*-*-*]} {
+    run_dump_tests [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
 }
diff --git a/gas/testsuite/gas/arm/armv1-bad.d b/gas/testsuite/gas/arm/armv1-bad.d
new file mode 100644 (file)
index 0000000..f6f1454
--- /dev/null
@@ -0,0 +1,3 @@
+#name: ARM v1 errors
+#as: -mcpu=arm7m
+#error-output: armv1-bad.l
index fb49708..e75c1fb 100644 (file)
@@ -1,6 +1,8 @@
 # name: bignums
 # as:
 # objdump: --full-contents
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
 
 .*: +file format .*arm.*
 
index 835e7a1..064c51f 100644 (file)
@@ -1,33 +1,34 @@
+# name: El Segundo instructions
+# objdump: -dr --prefix-addresses --show-raw-insn
 
-el_segundo.o:     file format elf32-littlearm
+.*: +file format .*arm.*
 
-Disassembly of section .text:
-
-00000000 <main>:
-   0:  c1003281        smlabbgt        r0, r1, r2, r3
-   4:  e1003281        smlabb  r0, r1, r2, r3
-   8:  e10032a1        smlatb  r0, r1, r2, r3
-   c:  e10032c1        smlabt  r0, r1, r2, r3
-  10:  e10032e1        smlatt  r0, r1, r2, r3
-  14:  c1203281        smlawbgt        r0, r1, r2, r3
-  18:  e1203281        smlawb  r0, r1, r2, r3
-  1c:  e12032c1        smlawt  r0, r1, r2, r3
-  20:  c1410382        smlalbbgt       r0, r1, r2, r3
-  24:  e1410382        smlalbb r0, r1, r2, r3
-  28:  e14103a2        smlaltb r0, r1, r2, r3
-  2c:  e14103c2        smlalbt r0, r1, r2, r3
-  30:  e14103e2        smlaltt r0, r1, r2, r3
-  34:  c1600281        smulbbgt        r0, r1, r2
-  38:  e1600281        smulbb  r0, r1, r2
-  3c:  e16002a1        smultb  r0, r1, r2
-  40:  e16002c1        smulbt  r0, r1, r2
-  44:  e16002e1        smultt  r0, r1, r2
-  48:  c12002a1        smulwbgt        r0, r1, r2
-  4c:  e12002a1        smulwb  r0, r1, r2
-  50:  e12002e1        smulwt  r0, r1, r2
-  54:  c1020051        qaddgt  r0, r1, r2
-  58:  e1020051        qadd    r0, r1, r2
-  5c:  e1420051        qdadd   r0, r1, r2
-  60:  e1220051        qsub    r0, r1, r2
-  64:  e1620051        qdsub   r0, r1, r2
-  68:  e1220051        qsub    r0, r1, r2
+Disassembly of section \.text:
+0+00 <[^>]+> c1003281  smlabbgt        r0, r1, r2, r3
+0+04 <[^>]+> e1003281  smlabb  r0, r1, r2, r3
+0+08 <[^>]+> e10032a1  smlatb  r0, r1, r2, r3
+0+0c <[^>]+> e10032c1  smlabt  r0, r1, r2, r3
+0+10 <[^>]+> e10032e1  smlatt  r0, r1, r2, r3
+0+14 <[^>]+> c1203281  smlawbgt        r0, r1, r2, r3
+0+18 <[^>]+> e1203281  smlawb  r0, r1, r2, r3
+0+1c <[^>]+> e12032c1  smlawt  r0, r1, r2, r3
+0+20 <[^>]+> c1410382  smlalbbgt       r0, r1, r2, r3
+0+24 <[^>]+> e1410382  smlalbb r0, r1, r2, r3
+0+28 <[^>]+> e14103a2  smlaltb r0, r1, r2, r3
+0+2c <[^>]+> e14103c2  smlalbt r0, r1, r2, r3
+0+30 <[^>]+> e14103e2  smlaltt r0, r1, r2, r3
+0+34 <[^>]+> c1600281  smulbbgt        r0, r1, r2
+0+38 <[^>]+> e1600281  smulbb  r0, r1, r2
+0+3c <[^>]+> e16002a1  smultb  r0, r1, r2
+0+40 <[^>]+> e16002c1  smulbt  r0, r1, r2
+0+44 <[^>]+> e16002e1  smultt  r0, r1, r2
+0+48 <[^>]+> c12002a1  smulwbgt        r0, r1, r2
+0+4c <[^>]+> e12002a1  smulwb  r0, r1, r2
+0+50 <[^>]+> e12002e1  smulwt  r0, r1, r2
+0+54 <[^>]+> c1020051  qaddgt  r0, r1, r2
+0+58 <[^>]+> e1020051  qadd    r0, r1, r2
+0+5c <[^>]+> e1420051  qdadd   r0, r1, r2
+0+60 <[^>]+> e1220051  qsub    r0, r1, r2
+0+64 <[^>]+> e1620051  qdsub   r0, r1, r2
+0+68 <[^>]+> e1220051  qsub    r0, r1, r2
+0+6c <[^>]+> e1a00000  nop                     \(mov r0,r0\)
index 9f403a1..2111b5e 100644 (file)
@@ -1,23 +1,9 @@
 # el_segundo.s
 #
 # Tests that we generate the right code for v5e instructions.
-# This is not a functional test, although it can be linked.
-# (The section at the rear is non-Coyanosa stuff for comparison.)
-# To verify a compiler, do:
-#      <gcc build area>/gcc/as el_segundo.s -o _temp.o
-#      <gcc build area>/binutils/objdump -dr _temp.o >! _temp.d
-#      diff _temp.d el_segundo.d
-
-       .section        .rdata
-       .align  0
-.LC0:
-       .ascii  "some data\000"
-
        .text
        .global main
-#      .type main,function
        .align  0
-
 main:
        smlabbgt r0,r1,r2,r3
        smlabb r0,r1,r2,r3
@@ -52,3 +38,6 @@ main:
        qsub r0,r1,r2
        qdsub r0,r1,r2
        qsub r0,r1,r2
+
+       @ padding for a.out's sake
+       nop
index 3207732..53b6cc1 100644 (file)
@@ -1,6 +1,8 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: ARM basic instructions
 #as: -mcpu=arm7m -EL
+# WinCE has its own version of this test.
+#skip: *-wince-*
 
 # Test the standard ARM instructions:
 
diff --git a/gas/testsuite/gas/arm/iwmmxt-bad.d b/gas/testsuite/gas/arm/iwmmxt-bad.d
new file mode 100644 (file)
index 0000000..6b44634
--- /dev/null
@@ -0,0 +1,3 @@
+#name: iWMMXt errors
+#as: -mcpu=iwmmxt
+#error-output: iwmmxt-bad.l
index 37a7338..846da89 100644 (file)
@@ -1,6 +1,9 @@
 #objdump: -s --section=.text
 #as: -EL
 #name: arm little-endian fpconst
+# Not all arm targets are bi-endian, so only run this test on ones
+# we know that are.  FIXME We should probably also key off armeb/armel.
+#target: *-*-pe
 
 .*: +file format .*arm.*
 
index 3a0ac1a..7d05107 100644 (file)
@@ -1,5 +1,7 @@
 #objdump: --syms --special-syms
 #name: ARM Mapping Symbols
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
 
 # Test the generation of ARM ELF Mapping Symbols
 
index e50a716..133614c 100644 (file)
@@ -1,5 +1,7 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: PIC
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
 
 # Test generation of PIC
 
diff --git a/gas/testsuite/gas/arm/r15-bad.d b/gas/testsuite/gas/arm/r15-bad.d
new file mode 100644 (file)
index 0000000..ec7c305
--- /dev/null
@@ -0,0 +1,2 @@
+#name: Invalid use of r15 errors
+#error-output: r15-bad.l
diff --git a/gas/testsuite/gas/arm/req.d b/gas/testsuite/gas/arm/req.d
new file mode 100644 (file)
index 0000000..41707ff
--- /dev/null
@@ -0,0 +1,3 @@
+#name: .req errors
+#as: -mcpu=arm7m
+#error-output: req.l
diff --git a/gas/testsuite/gas/arm/t16-bad.d b/gas/testsuite/gas/arm/t16-bad.d
new file mode 100644 (file)
index 0000000..b5603ad
--- /dev/null
@@ -0,0 +1,3 @@
+#name: Valid ARM, invalid Thumb
+#as: -march=armv6k
+#error-output: t16-bad.l
index 5c33adf..0002a7c 100644 (file)
@@ -1,6 +1,8 @@
 # name: Thumb instructions
 # as: -mcpu=arm7t
 # objdump: -dr --prefix-addresses --show-raw-insn
+# The arm-aout and arm-pe ports do not support Thumb branch relocations.
+# not-target: *-*-*aout* *-*-pe
 
 .*: +file format .*arm.*
 
index 6bd07ac..eec0162 100644 (file)
@@ -1,6 +1,8 @@
 # name: 32-bit Thumb instructions
 # as: -march=armv6kt2
 # objdump: -dr --prefix-addresses --show-raw-insn
+# The arm-aout and arm-pe ports do not support Thumb branch relocations.
+# not-target: *-*-*aout* *-*-pe
 
 .*: +file format .*arm.*
 
index 71a1a6f..5b41109 100644 (file)
@@ -1,5 +1,9 @@
 #objdump: -dr
 #name: TLS
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+# VxWorks needs a special variant of this file.
+#skip: *-*-vxworks*
 
 # Test generation of TLS relocations
 
diff --git a/gas/testsuite/gas/arm/tls_vxworks.d b/gas/testsuite/gas/arm/tls_vxworks.d
new file mode 100644 (file)
index 0000000..ec80e65
--- /dev/null
@@ -0,0 +1,30 @@
+#objdump: -dr
+#name: TLS
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+# This is the VxWorks variant of this file.
+#source: tls.s
+#not-skip: *-*-vxworks*
+
+# Test generation of TLS relocations
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+
+00+0 <main>:
+   0:  e1a00000        nop                     \(mov r0,r0\)
+   4:  e1a00000        nop                     \(mov r0,r0\)
+   8:  e1a0f00e        mov     pc, lr
+   c:  00000000        andeq   r0, r0, r0
+                       c: R_ARM_TLS_GD32       a
+# ??? The addend is appearing in both the RELA field and the
+# contents.  Shouldn't it be just one?  bfd_install_relocation
+# appears to write the addend into the contents unconditionally,
+# yet somehow this does not happen for the majority of relocations.
+  10:  00000004        andeq   r0, r0, r4
+                       10: R_ARM_TLS_LDM32     b\+0x4
+  14:  00000008        andeq   r0, r0, r8
+                       14: R_ARM_TLS_IE32      c\+0x8
+  18:  00000000        andeq   r0, r0, r0
+                       18: R_ARM_TLS_LE32      d
diff --git a/gas/testsuite/gas/arm/undefined.d b/gas/testsuite/gas/arm/undefined.d
new file mode 100644 (file)
index 0000000..6a61495
--- /dev/null
@@ -0,0 +1,4 @@
+#name: Undefined local label error
+# COFF and aout based ports use a different naming convention for local labels.
+#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+#error-output: undefined.l
diff --git a/gas/testsuite/gas/arm/undefined_coff.d b/gas/testsuite/gas/arm/undefined_coff.d
new file mode 100644 (file)
index 0000000..ab0bbcd
--- /dev/null
@@ -0,0 +1,4 @@
+#name: Undefined local label error
+# COFF and aout based ports use a different naming convention for local labels.
+#not-skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+#error-output: undefined_coff.l
index 982040b..2a04d44 100644 (file)
@@ -1,5 +1,9 @@
 #objdump: -sr
 #name: Unwind table generation
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+# VxWorks needs a special variant of this file.
+#skip: *-*-vxworks*
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/arm/unwind_vxworks.d b/gas/testsuite/gas/arm/unwind_vxworks.d
new file mode 100644 (file)
index 0000000..905788d
--- /dev/null
@@ -0,0 +1,40 @@
+#objdump: -sr
+#name: Unwind table generation
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+# This is the VxWorks variant of this file.
+#source: unwind.s
+#not-skip: *-*-vxworks*
+
+.*:     file format.*
+
+RELOCATION RECORDS FOR \[.ARM.extab\]:
+OFFSET   TYPE              VALUE 
+0000000c R_ARM_PREL31      .text\+0x0+c
+
+
+RELOCATION RECORDS FOR \[.ARM.exidx\]:
+OFFSET   TYPE              VALUE 
+00000000 R_ARM_PREL31      .text
+00000000 R_ARM_NONE        __aeabi_unwind_cpp_pr0
+00000008 R_ARM_PREL31      .text.*
+00000008 R_ARM_NONE        __aeabi_unwind_cpp_pr1\+0x0+8
+0000000c R_ARM_PREL31      .ARM.extab\+0x0+c
+00000010 R_ARM_PREL31      .text.*
+00000014 R_ARM_PREL31      .ARM.extab.*
+00000018 R_ARM_PREL31      .text.*
+0000001c R_ARM_PREL31      .ARM.extab.*
+00000020 R_ARM_PREL31      .text.*
+
+
+Contents of section .text:
+ 0000 (0000a0e3 0100a0e3 0200a0e3 0300a0e3|e3a00000 e3a00001 e3a00002 e3a00003)  .*
+ 0010 (0420|2004)                                 .*
+Contents of section .ARM.extab:
+ 0000 (449b0181 b0b08086|81019b44 8680b0b0) 00000000 00000000  .*
+ 0010 (8402b101 b0b0b005 2a000000 00c60181|01b10284 05b0b0b0 0000002a 8101c600)  .*
+ 0020 (b0b0c1c1|c1c1b0b0) 00000000                    .*
+Contents of section .ARM.exidx:
+ 0000 00000000 (b0b0a880 00000000|80a8b0b0 00000000) 00000000  .*
+ 0010 00000000 00000000 00000000 00000000  .*
+ 0020 (00000000 08849780|00000000 80978408)                    .*
diff --git a/gas/testsuite/gas/arm/vfp-bad.d b/gas/testsuite/gas/arm/vfp-bad.d
new file mode 100644 (file)
index 0000000..760c4d5
--- /dev/null
@@ -0,0 +1,3 @@
+#name: VFP errors
+#as: -mfpu=vfp
+#error-output: vfp-bad.l
index 2543f0b..651464d 100644 (file)
@@ -2,6 +2,8 @@
 #name: ARM basic instructions (WinCE version)
 #as: -mcpu=arm7m -EL
 #source: inst.s
+# inst.d is used for non-WinCE targets.
+#not-skip: *-wince-*
 
 # This file is the same as inst.d except that the BL
 # instructions have not had a -8 bias inserted.
index 54593bc..827e22f 100644 (file)
@@ -233,6 +233,24 @@ proc is_elf_format {} {
     return 1
 }
 
+# run_dump_tests TESTCASES EXTRA_OPTIONS
+# Wrapper for run_dump_test, which is suitable for invoking as
+#   run_dump_tests [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+# EXTRA_OPTIONS are passed down to run_dump_test.  Honors runtest_file_p.
+# Body cribbed from dg-runtest.
+
+proc run_dump_tests { testcases {extra_options {}} } {
+    global runtests
+
+    foreach testcase $testcases {
+        # If testing specific files and this isn't one of them, skip it.
+        if ![runtest_file_p $runtests $testcase] {
+            continue
+        }
+        run_dump_test [file rootname [file tail $testcase]] $extra_options
+    }
+}
+
 
 # run_dump_test FILE (optional:) EXTRA_OPTIONS
 #
@@ -255,8 +273,10 @@ proc is_elf_format {} {
 # OPTION is the name of some option, like "name" or "objdump", and
 # VALUE is OPTION's value.  The valid options are described below.
 # Whitespace is ignored everywhere, except within VALUE.  The option
-# list ends with the first line that doesn't match the above syntax
-# (hmm, not great for error detection).
+# list ends with the first line that doesn't match the above syntax.
+# However, a line within the options that begins with a #, but doesn't
+# have a recognizable option name followed by a colon, is considered a
+# comment and entirely ignored.
 #
 # The optional EXTRA_OPTIONS argument to `run_dump_test' is a list of
 # two-element lists.  The first element of each is an option name, and
@@ -292,6 +312,27 @@ proc is_elf_format {} {
 #      Assemble the file SOURCE.s.  If omitted, this defaults to FILE.s.
 #       This is useful if several .d files want to share a .s file.
 #
+#   target: GLOBS...
+#       Run this test only on a specified list of targets.  More precisely,
+#       each glob in the space-separated list is passed to "istarget"; if
+#       it evaluates true for any of them, the test will be run, otherwise
+#       it will be marked unsupported.
+#
+#   not-target: GLOBS...
+#       Do not run this test on a specified list of targets.  Again,
+#       the each glob in the space-separated list is passed to
+#       "istarget", and the test is run if it evaluates *false* for
+#       *all* of them.  Otherwise it will be marked unsupported.
+#
+#   skip: GLOBS...
+#   not-skip: GLOBS...
+#       These are exactly the same as "not-target" and "target",
+#       respectively, except that they do nothing at all if the check
+#       fails.  They should only be used in groups, to construct a single
+#       test which is run on all targets but with variant options or
+#       expected output on some targets.  (For example, see
+#       gas/arm/inst.d and gas/arm/wince_inst.d.)
+#
 #   error: REGEX
 #      An error with message matching REGEX must be emitted for the test
 #      to pass.  The PROG, objdump, nm and objcopy options have no
@@ -301,6 +342,16 @@ proc is_elf_format {} {
 #      Expect a gas warning matching REGEX.  It is an error to issue
 #      both "error" and "warning".
 #
+#   stderr: FILE
+#       FILE contains regexp lines to be matched against the diagnostic
+#       output of the assembler.  This does not preclude the use of
+#       PROG, nm, objdump, or objcopy.
+#
+#   error-output: FILE
+#       Means the same as 'stderr', but also indicates that the assembler
+#       is expected to exit unsuccessfully (therefore PROG, objdump, nm,
+#       and objcopy have no meaning and should not be supplied).
+#
 # Each option may occur at most once.
 #
 # After the option lines come regexp lines.  `run_dump_test' calls
@@ -337,7 +388,12 @@ proc run_dump_test { name {extra_options {}} } {
     set opts(source) {}
     set opts(stderr) {}
     set opts(error) {}
+    set opts(error-output) {}
     set opts(warning) {}
+    set opts(target) {}
+    set opts(not-target) {}
+    set opts(skip) {}
+    set opts(not-skip) {}
 
     foreach i $opt_array {
        set opt_name [lindex $i 0]
@@ -371,16 +427,30 @@ proc run_dump_test { name {extra_options {}} } {
        append opts($opt_name) $opt_val
     }
 
+    if { $opts(name) == "" } {
+       set testname "$subdir/$name"
+    } else {
+       set testname $opts(name)
+    }
+    verbose "Testing $testname"
+
     if { (($opts(warning) != "") && ($opts(error) != "")) \
-        || (($opts(warning) != "") && ($opts(stderr) != "")) } {
-       perror "$testname: bad mix of stderr, error and warning test-directives"
+        || (($opts(warning) != "") && ($opts(stderr) != "")) \
+        || (($opts(error-output) != "") && ($opts(stderr) != "")) \
+        || (($opts(error-output) != "") && ($opts(error) != "")) \
+        || (($opts(error-output) != "") && ($opts(warning) != "")) } {
+       perror "$testname: bad mix of stderr, error-output, error, and warning test-directives"
+       unresolved $testname
        return
     }
+    if { $opts(error-output) != "" } then {
+       set opts(stderr) $opts(error-output)
+    }
 
     set program ""
     # It's meaningless to require an output-testing method when we
     # expect an error.
-    if { $opts(error) == "" } {
+    if { $opts(error) == "" && $opts(error-output) == "" } {
        if {$opts(PROG) != ""} {
            switch -- $opts(PROG) {
                objdump { set program objdump }
@@ -389,7 +459,7 @@ proc run_dump_test { name {extra_options {}} } {
                readelf { set program readelf }
                default {
                    perror "unrecognized program option $opts(PROG) in $file.d"
-                   unresolved $subdir/$name
+                   unresolved $testname
                    return }
            }
        } else {
@@ -398,7 +468,7 @@ proc run_dump_test { name {extra_options {}} } {
                if {$opts($p) != ""} {
                    if {$program != ""} {
                        perror "ambiguous dump program in $file.d"
-                       unresolved $subdir/$name
+                       unresolved $testname
                        return
                    } else {
                        set program $p
@@ -408,17 +478,62 @@ proc run_dump_test { name {extra_options {}} } {
        }
        if { $program == "" && $opts(warning) == "" } {
            perror "dump program unspecified in $file.d"
-           unresolved $subdir/$name
+           unresolved $testname
            return
        }
     }
 
-    if { $opts(name) == "" } {
-       set testname "$subdir/$name"
-    } else {
-       set testname $opts(name)
+    # Handle skipping the test on specified targets.
+    # You can have both skip/not-skip and target/not-target, but you can't
+    # have both skip and not-skip, or target and not-target, in the same file.
+    if { $opts(skip) != "" } then {
+       if { $opts(not-skip) != "" } then {
+           perror "$testname: mixing skip and not-skip directives is invalid"
+           unresolved $testname
+           return
+       }
+       foreach glob $opts(skip) {
+           if {[istarget $glob]} { return }
+       }
+    }
+    if { $opts(not-skip) != "" } then {
+       set skip 1
+       foreach glob $opts(not-skip) {
+           if {[istarget $glob]} { 
+               set skip 0
+               break
+           }
+       }
+       if {$skip} { return }
+    }
+    if { $opts(target) != "" } then {
+       if { $opts(not-target) != "" } then {
+           perror "$testname: mixing target and not-target directives is invalid"
+           unresolved $testname
+           return
+       }
+       set skip 1
+       foreach glob $opts(target) {
+           if {[istarget $glob]} { 
+               set skip 0
+               break
+           }
+       }
+       if {$skip} { 
+           unsupported $testname
+           return 
+       }
+    }
+    if { $opts(not-target) != "" } then {
+       foreach glob $opts(not-target) {
+           if {[istarget $glob]} {
+               unsupported $testname
+               return 
+           }
+       }
     }
 
+
     if { $opts(source) == "" } {
        set sourcefile ${file}.s
     } else {
@@ -449,10 +564,9 @@ proc run_dump_test { name {extra_options {}} } {
        set exitstat "succeeded"
        if { $cmdret != 0 } { set exitstat "failed" }
 
+       send_log "$comp_output\n"
+       verbose "$comp_output" 3
        if { $opts(stderr) == "" }  then {
-           send_log "$comp_output\n"
-           verbose "$comp_output" 3
-
            if { [regexp $expmsg $comp_output] \
                    && (($cmdret == 0) == ($opts(warning) != "")) } {
                # We have the expected output from gas.
@@ -478,7 +592,6 @@ proc run_dump_test { name {extra_options {}} } {
                return
            }
            set stderrfile $srcdir/$subdir/$opts(stderr)
-           send_log "wrote pruned stderr to dump.stderr\n"
            verbose "wrote pruned stderr to dump.stderr" 3
            if { [regexp_diff "dump.stderr" "$stderrfile"] } then {
                if { $opts(error) != "" } {
@@ -491,6 +604,9 @@ proc run_dump_test { name {extra_options {}} } {
                fail $testname
                verbose "pruned stderr is [file_contents "dump.stderr"]" 2
                return
+           } elseif { $opts(error-output) != "" } then {
+               pass $testname
+               return
            }
        }
     }
@@ -557,15 +673,15 @@ proc slurp_options { file } {
     set ws  {[         ]*}
     set nws {[^        ]*}
     # whitespace is ignored anywhere except within the options list;
-    # option names are alphabetic only
-    set pat "^#${ws}(\[a-zA-Z\]*)$ws:${ws}(.*)$ws\$"
+    # option names are alphabetic plus dash
+    set pat "^#${ws}(\[a-zA-Z-\]*)$ws:${ws}(.*)$ws\$"
     while { [gets $f line] != -1 } {
        set line [string trim $line]
        # Whitespace here is space-tab.
        if [regexp $pat $line xxx opt_name opt_val] {
            # match!
            lappend opt_array [list $opt_name $opt_val]
-       } else {
+       } elseif {![regexp "^#" $line ]} {
            break
        }
     }