Use is_xcoff_format in binutils testsuite
authorAlan Modra <amodra@gmail.com>
Tue, 7 Jul 2020 02:00:12 +0000 (11:30 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 7 Jul 2020 08:56:33 +0000 (18:26 +0930)
and restrict some other tests using is_*_format.

* testsuite/binutils-all/ar.exp: Use is_xcoff_format.
* testsuite/binutils-all/nm.exp: Likewise.
* testsuite/binutils-all/copy-2.d: Run only for elf and pe targets.
* testsuite/binutils-all/copy-3.d: Run only for elf targets.
* testsuite/binutils-all/set-section-alignment.d: Likewise.
* testsuite/binutils-all/copy-4.d: Don't run for xcoff.

binutils/ChangeLog
binutils/testsuite/binutils-all/ar.exp
binutils/testsuite/binutils-all/copy-2.d
binutils/testsuite/binutils-all/copy-3.d
binutils/testsuite/binutils-all/copy-4.d
binutils/testsuite/binutils-all/nm.exp
binutils/testsuite/binutils-all/set-section-alignment.d

index 47cad6ee2328929fb13568ec724437d506704c35..55a75afab5f315d9e755862e69d3d00e0f635c96 100644 (file)
@@ -1,3 +1,12 @@
+2020-07-07  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/binutils-all/ar.exp: Use is_xcoff_format.
+       * testsuite/binutils-all/nm.exp: Likewise.
+       * testsuite/binutils-all/copy-2.d: Run only for elf and pe targets.
+       * testsuite/binutils-all/copy-3.d: Run only for elf targets.
+       * testsuite/binutils-all/set-section-alignment.d: Likewise.
+       * testsuite/binutils-all/copy-4.d: Don't run for xcoff.
+
 2020-07-07  Alan Modra  <amodra@gmail.com>
 
        * testsuite/lib/binutils-common.exp (is_xcoff_format): New.
index 86827814d79e9ee185356dbc11fcc0f6db069cef..5a9d27c6d0b04b25be4bf3685ac62dd94335fe2f 100644 (file)
@@ -727,7 +727,7 @@ if { [file exists $base_dir/bfdtest1] && [file exists $base_dir/bfdtest2] } {
     long_filenames $bfdtests
 
     # xcoff, ecoff, and vms archive support doesn't handle thin archives
-    if { ![istarget "*-*-aix*"]
+    if { ![is_xcoff_format]
         && ![istarget "*-*-*ecoff"]
         && ![istarget "*-*-vms"] } {
        thin_archive $bfdtests
index 9eda63bc87a5f8c4379710aa0d53e71c9c74ee29..8d066c53c5a7f23c53baf08016d94313e0e703f1 100644 (file)
@@ -3,10 +3,9 @@
 #objcopy: --set-section-flags foo=contents,alloc,load,code
 #name: copy with setting section flags 2
 #source: copytest.s
-#notarget: *-*-*aout *-*-aix* h8300-*-* hppa*-*-hpux* mips-*-ultrix* mips-*-osf* mips-*-ecoff* mips-*-irix mips-*-irix[2-4] mips-*-riscos* ns32k-*-*
-# Note - we use copytest.s and a section named "foo" rather
-# than .text because for some file formats (eg PE) the .text
-# section has a fixed set of flags and these cannot be changed.
+# Many formats do not allow arbitrary section flags, just run for ELF and PE.
+#target: [is_elf_format] [is_pecoff_format]
+#xfail: h8300-*-*
 
 .*: +file format .*
 
index dd28719e8b998dd2b4633385faad74d8aa521dd4..63e84c7163f175913536f72bcaf51b8ff75cc694 100644 (file)
@@ -3,9 +3,10 @@
 #objcopy: --set-section-flags .text=alloc,data
 #name: copy with setting section flags 3
 #source: bintest.s
-#notarget: *-*-*aout *-*-*coff *-*-cygwin* *-*-darwin *-*-mingw* *-*-go32 *-*-*pe hppa*-*-hpux* ns32k-*-* powerpc-*-aix* rs6000-*-* rx-*-*
-# The .text # section in PE/COFF has a fixed set of flags and these
-# cannot be changed.  We skip it for them.
+# The .text section in most formats has a fixed set of flags which
+# cannot be changed, just run for ELF.
+#target: [is_elf_format]
+#xfail: rx-*-*
 
 .*: +file format .*
 
index 554c8941504dab74b0be086963aebeab035459c3..fa09182f235c5050229b82bd8b460a2f9b5de979 100644 (file)
@@ -2,7 +2,7 @@
 #source: bintest.s
 #strip: --strip-unneeded
 #nm: -n
-#notarget: *-*-aix* *-*-linuxecoff
+#notarget: [is_xcoff_format] *-*-linuxecoff
 #name: strip --strip-unneeded on common symbol
 
 #...
index 8964014f303ecad75ba77748b61738b59b52345d..96cb50a300ac7919d22f5cf937802d772764017e 100644 (file)
@@ -50,7 +50,9 @@ if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
 
     # This test does not work correctly on XCOFF targets, because XCOFF
     # does not enter static symbols in the symbol table.
-    setup_xfail "*-*-aix*"
+    if [is_xcoff_format] {
+       setup_xfail *-*-*
+    }
 
     set got [binutils_run $NM "$NMFLAGS $tempfile"]
 
@@ -108,7 +110,9 @@ if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
 
     # This test does not work correctly on XCOFF targets, because XCOFF
     # does not enter static symbols in the symbol table.
-    setup_xfail "*-*-aix*"
+    if [is_xcoff_format] {
+       setup_xfail *-*-*
+    }
 
     set got [binutils_run $NM "$NMFLAGS -P $tempfile"]
 
index d562ce1503809c2da1d170cb994f79cebe32a1ff..a193bb78973b285b1ddcf53f28de5b7f0ad94ce6 100644 (file)
@@ -2,7 +2,8 @@
 #PROG: objcopy
 #objcopy: --set-section-alignment .text=16
 #objdump: --section-headers
-#notarget: *-*-*aout *-*-*coff *-*-cygwin* *-*-darwin *-*-mingw* *-*-go32 *-*-*pe hppa*-*-hpux* ns32k-*-* powerpc-*-aix* rs6000-*-* rx-*-* *-*-vms
+#target: [is_elf_format]
+#xfail: rx-*-*
 
 #...
 .*\.text.*2\*\*4
This page took 0.026396 seconds and 4 git commands to generate.