]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
xtensa: gas: convert tests to run_dump_tests
authorMax Filippov <jcmvbkbc@gmail.com>
Fri, 5 Apr 2019 00:51:00 +0000 (17:51 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Thu, 11 Apr 2019 18:41:36 +0000 (11:41 -0700)
gas/
2019-04-11  Max Filippov  <jcmvbkbc@gmail.com>

* testsuite/gas/xtensa/all.exp: Remove all expect-based
tests and all explicit run_dump_test / run_list_test
invocations. Add run_dump_tests for all .d files in the
test subdirectory.
* testsuite/gas/xtensa/entry_align.d: New test definition.
* testsuite/gas/xtensa/entry_align.l: New test output.
* testsuite/gas/xtensa/entry_misalign.d: New test definition.
* testsuite/gas/xtensa/entry_misalign2.d: New test definition.
* testsuite/gas/xtensa/j_too_far.d: New test definition.
* testsuite/gas/xtensa/j_too_far.l: New test output.
* testsuite/gas/xtensa/loop_align.d: New test definition.
* testsuite/gas/xtensa/loop_misalign.d: New test definition.
* testsuite/gas/xtensa/trampoline-2.d: New test definition.
* testsuite/gas/xtensa/trampoline-2.l: Remove empty output.
* testsuite/gas/xtensa/xtensa-err.exp: Use positive logic.

13 files changed:
gas/ChangeLog
gas/testsuite/gas/xtensa/all.exp
gas/testsuite/gas/xtensa/entry_align.d [new file with mode: 0644]
gas/testsuite/gas/xtensa/entry_align.l [new file with mode: 0644]
gas/testsuite/gas/xtensa/entry_misalign.d [new file with mode: 0644]
gas/testsuite/gas/xtensa/entry_misalign2.d [new file with mode: 0644]
gas/testsuite/gas/xtensa/j_too_far.d [new file with mode: 0644]
gas/testsuite/gas/xtensa/j_too_far.l [new file with mode: 0644]
gas/testsuite/gas/xtensa/loop_align.d [new file with mode: 0644]
gas/testsuite/gas/xtensa/loop_misalign.d [new file with mode: 0644]
gas/testsuite/gas/xtensa/trampoline-2.d [new file with mode: 0644]
gas/testsuite/gas/xtensa/trampoline-2.l [deleted file]
gas/testsuite/gas/xtensa/xtensa-err.exp

index 52dd5f32160224d690332e13fa07832fb3e7ecdd..c41be94f922fd39819a7b8c5ac494742608b2e32 100644 (file)
@@ -1,3 +1,21 @@
+2019-04-11  Max Filippov  <jcmvbkbc@gmail.com>
+
+       * testsuite/gas/xtensa/all.exp: Remove all expect-based
+       tests and all explicit run_dump_test / run_list_test
+       invocations. Add run_dump_tests for all .d files in the
+       test subdirectory.
+       * testsuite/gas/xtensa/entry_align.d: New test definition.
+       * testsuite/gas/xtensa/entry_align.l: New test output.
+       * testsuite/gas/xtensa/entry_misalign.d: New test definition.
+       * testsuite/gas/xtensa/entry_misalign2.d: New test definition.
+       * testsuite/gas/xtensa/j_too_far.d: New test definition.
+       * testsuite/gas/xtensa/j_too_far.l: New test output.
+       * testsuite/gas/xtensa/loop_align.d: New test definition.
+       * testsuite/gas/xtensa/loop_misalign.d: New test definition.
+       * testsuite/gas/xtensa/trampoline-2.d: New test definition.
+       * testsuite/gas/xtensa/trampoline-2.l: Remove empty output.
+       * testsuite/gas/xtensa/xtensa-err.exp: Use positive logic.
+
 2019-04-11  Max Filippov  <jcmvbkbc@gmail.com>
 
        * config/tc-xtensa.c (xtensa_literal_pseudo): Drop code that has
index 30784becbe0add4d19592609e0ce08ff2be474fb..db1a623c0ad2b9066e9dbf389ee49bc9ef87f611 100644 (file)
 #
 # Some generic xtensa tests
 #
-if [istarget xtensa*-*-*] then {
-    gas_test_error "j_too_far.s" "" "Check for jump out of range error"
-
-    set testname "j_too_far.s: error line number reporting"
-    gas_start "j_too_far.s" ""
-    set x1 0
-    while 1 {
-        expect {
-            -re ":4: Error:.*out of range"      { set x1 1 }
-            timeout                             { perror "timeout\n"; break }
-            eof                                 { break }
-        }
-    }
-    gas_finish
-    if [all_ones $x1] then { pass $testname } else { fail $testname }
-
-
-    gas_test "entry_misalign.s" "" "" "Xtensa Entry misalignment"
-    set testname "entry_misalign.s: Force entry misalignment"
-    objdump_start_no_subdir "a.out" "-d -j .text"
-    set x1 0
-    while 1 {
-       expect {
-           -re "^.*2:.*entry" { set x1 1 }
-           timeout            { perror "timeout\n"; break }
-           eof                { break }
-       }
-    }
-    objdump_finish
-    if [all_ones $x1] then { pass $testname } else { fail $testname }
-
-
-    gas_test "entry_misalign2.s" "" "" "Xtensa Entry misalignment(2)"
-    set testname "entry_misalign2.s: Force entry misalignment(2)"
-    objdump_start_no_subdir "a.out" "-d -j .text"
-    set x1 0
-    while 1 {
-       expect {
-           -re "^.*2:.*entry" { set x1 1 }
-           timeout            { perror "timeout\n"; break }
-           eof                { break }
-       }
-    }
-    objdump_finish
-    if [all_ones $x1] then { pass $testname } else { fail $testname }
-
-    gas_test_error "entry_align.s" "" "Xtensa entry alignment error"
-
-    gas_test "loop_misalign.s" "" "" "Xtensa Loop misalignment"
-    set testname "loop_misalign.s: Force loop misalignment"
-    objdump_start_no_subdir "a.out" "-d -j .text"
-    set x1 0
-    while 1 {
-       expect {
-           -re "^.*0:.*loop" { set x1 1 }
-           timeout            { perror "timeout\n"; break }
-           eof                { break }
-       }
-    }
-    objdump_finish
-    if [all_ones $x1] then { pass $testname } else { fail $testname }
-
-
-    gas_test "loop_align.s" "" "" "Xtensa autoalign loop"
-    set testname "loop_align.s: autoalign loop"
-    objdump_start_no_subdir "a.out" "-d -j .text"
-    set x1 0
-    while 1 {
-       expect {
-           -re "^.*2:.*loop" { set x1 1 }
-           timeout            { perror "timeout\n"; break }
-           eof                { break }
-       }
-    }
-    objdump_finish
-    if [all_ones $x1] then { pass $testname } else { fail $testname }
-
-    run_dump_test "short_branch_offset"
-    run_dump_test "pcrel"
-    run_dump_test "weak-call"
-    run_dump_test "jlong"
-    run_dump_test "trampoline"
-    run_list_test "trampoline-2"
-    run_dump_test "first_frag_align"
-    run_dump_test "auto-litpools"
-    run_dump_test "auto-litpools-2"
-    run_dump_test "auto-litpools-3"
-    run_dump_test "auto-litpools-4"
-    run_dump_test "auto-litpools-first1"
-    run_dump_test "auto-litpools-first2"
-    run_dump_test "loc"
-    run_dump_test "init-fini-literals"
-    run_dump_test "text-section-literals-1"
-}
-
-if [info exists errorInfo] then {
-    unset errorInfo
+if [istarget xtensa*-*-*] {
+       run_dump_tests [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
 }
diff --git a/gas/testsuite/gas/xtensa/entry_align.d b/gas/testsuite/gas/xtensa/entry_align.d
new file mode 100644 (file)
index 0000000..684e654
--- /dev/null
@@ -0,0 +1,3 @@
+#as:
+#name: unaligned entry instruction
+#error_output: entry_align.l
diff --git a/gas/testsuite/gas/xtensa/entry_align.l b/gas/testsuite/gas/xtensa/entry_align.l
new file mode 100644 (file)
index 0000000..9bca67c
--- /dev/null
@@ -0,0 +1,2 @@
+[^:]*: Assembler messages:
+[^:]*:3: Error: unaligned entry instruction
diff --git a/gas/testsuite/gas/xtensa/entry_misalign.d b/gas/testsuite/gas/xtensa/entry_misalign.d
new file mode 100644 (file)
index 0000000..aa79bd4
--- /dev/null
@@ -0,0 +1,7 @@
+#as:
+#objdump: -d -j .text
+#name: force entry instruction misalignment
+
+#...
+^.*2:.*entry.*
+#...
diff --git a/gas/testsuite/gas/xtensa/entry_misalign2.d b/gas/testsuite/gas/xtensa/entry_misalign2.d
new file mode 100644 (file)
index 0000000..74664ef
--- /dev/null
@@ -0,0 +1,7 @@
+#as:
+#objdump: -d -j .text
+#name: entry instruction misalignment inside no-transform block
+
+#...
+^.*2:.*entry.*
+#...
diff --git a/gas/testsuite/gas/xtensa/j_too_far.d b/gas/testsuite/gas/xtensa/j_too_far.d
new file mode 100644 (file)
index 0000000..85007af
--- /dev/null
@@ -0,0 +1,3 @@
+#as:
+#name: jump to a target that is too far
+#error_output: j_too_far.l
diff --git a/gas/testsuite/gas/xtensa/j_too_far.l b/gas/testsuite/gas/xtensa/j_too_far.l
new file mode 100644 (file)
index 0000000..38d3c79
--- /dev/null
@@ -0,0 +1,2 @@
+[^:]*: Assembler messages:
+[^:]*:4: Error:.*operand 1 of 'j' has out of range value.*
diff --git a/gas/testsuite/gas/xtensa/loop_align.d b/gas/testsuite/gas/xtensa/loop_align.d
new file mode 100644 (file)
index 0000000..a4da096
--- /dev/null
@@ -0,0 +1,7 @@
+#as:
+#objdump: -d -j .text
+#name: automatic loop alignment
+
+#...
+^.*2:.*loop.*
+#...
diff --git a/gas/testsuite/gas/xtensa/loop_misalign.d b/gas/testsuite/gas/xtensa/loop_misalign.d
new file mode 100644 (file)
index 0000000..88bddc2
--- /dev/null
@@ -0,0 +1,7 @@
+#as:
+#objdump: -d -j .text
+#name: force loop misalignment
+
+#...
+^.*2:.*loop.*
+#...
diff --git a/gas/testsuite/gas/xtensa/trampoline-2.d b/gas/testsuite/gas/xtensa/trampoline-2.d
new file mode 100644 (file)
index 0000000..535dde7
--- /dev/null
@@ -0,0 +1,4 @@
+#as:
+#readelf: -a
+
+#...
diff --git a/gas/testsuite/gas/xtensa/trampoline-2.l b/gas/testsuite/gas/xtensa/trampoline-2.l
deleted file mode 100644 (file)
index 36a0971..0000000
+++ /dev/null
@@ -1 +0,0 @@
-# No warnings or errors expected!
index 5a2ed680cd89bcbb73da454fcc935e36562b5f95..f2937b847fe4128fbff33abf0389de94589dc222 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 
-if { ! [istarget "xtensa*-*-*"] } {
-    return
-}
-
-proc run_xtensa_err_tests { } {
+if [istarget xtensa*-*-*] {
     global srcdir subdir runtests
 
     load_lib gas-dg.exp
@@ -26,5 +22,3 @@ proc run_xtensa_err_tests { } {
     dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/err-*.s]] "" ""
     dg-finish
 }
-
-run_xtensa_err_tests