This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] xtensa: gas: add relaxations tests


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c0b4cd465573f1772927cb3ad5d6e7d17af21622

commit c0b4cd465573f1772927cb3ad5d6e7d17af21622
Author: Max Filippov <jcmvbkbc@gmail.com>
Date:   Thu Apr 4 17:06:57 2019 -0700

    xtensa: gas: add relaxations tests
    
    gas/
    2019-04-11  Max Filippov  <jcmvbkbc@gmail.com>
    
    	* testsuite/gas/xtensa/loop-relax-2.d: New test definition.
    	* testsuite/gas/xtensa/loop-relax.d: New test definition.
    	* testsuite/gas/xtensa/loop-relax.s: New test source.
    	* testsuite/gas/xtensa/text-section-literals-1a.d: New test
    	definition.
    	* testsuite/gas/xtensa/text-section-literals-2.d: New test
    	definition.
    	* testsuite/gas/xtensa/text-section-literals-2.s: New test
    	source.
    	* testsuite/gas/xtensa/text-section-literals-2a.d: New test
    	definition.
    	* testsuite/gas/xtensa/text-section-literals-3.d: New test
    	definition.
    	* testsuite/gas/xtensa/text-section-literals-3.s: New test
    	source.
    	* testsuite/gas/xtensa/text-section-literals-4.d: New test
    	definition.
    	* testsuite/gas/xtensa/text-section-literals-4.s: New test
    	source.
    	* testsuite/gas/xtensa/text-section-literals-4a.d: New test
    	definition.

Diff:
---
 gas/ChangeLog                                      | 24 +++++++++
 gas/testsuite/gas/xtensa/loop-relax-2.d            |  7 +++
 gas/testsuite/gas/xtensa/loop-relax.d              | 14 ++++++
 gas/testsuite/gas/xtensa/loop-relax.s              | 58 ++++++++++++++++++++++
 .../gas/xtensa/text-section-literals-1a.d          | 18 +++++++
 gas/testsuite/gas/xtensa/text-section-literals-2.d |  9 ++++
 gas/testsuite/gas/xtensa/text-section-literals-2.s |  3 ++
 .../gas/xtensa/text-section-literals-2a.d          | 10 ++++
 gas/testsuite/gas/xtensa/text-section-literals-3.d | 11 ++++
 gas/testsuite/gas/xtensa/text-section-literals-3.s |  3 ++
 gas/testsuite/gas/xtensa/text-section-literals-4.d |  9 ++++
 gas/testsuite/gas/xtensa/text-section-literals-4.s |  3 ++
 .../gas/xtensa/text-section-literals-4a.d          | 10 ++++
 13 files changed, 179 insertions(+)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index c41be94..12350c7 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,29 @@
 2019-04-11  Max Filippov  <jcmvbkbc@gmail.com>
 
+	* testsuite/gas/xtensa/loop-relax-2.d: New test definition.
+	* testsuite/gas/xtensa/loop-relax.d: New test definition.
+	* testsuite/gas/xtensa/loop-relax.s: New test source.
+	* testsuite/gas/xtensa/text-section-literals-1a.d: New test
+	definition.
+	* testsuite/gas/xtensa/text-section-literals-2.d: New test
+	definition.
+	* testsuite/gas/xtensa/text-section-literals-2.s: New test
+	source.
+	* testsuite/gas/xtensa/text-section-literals-2a.d: New test
+	definition.
+	* testsuite/gas/xtensa/text-section-literals-3.d: New test
+	definition.
+	* testsuite/gas/xtensa/text-section-literals-3.s: New test
+	source.
+	* testsuite/gas/xtensa/text-section-literals-4.d: New test
+	definition.
+	* testsuite/gas/xtensa/text-section-literals-4.s: New test
+	source.
+	* testsuite/gas/xtensa/text-section-literals-4a.d: New test
+	definition.
+
+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
diff --git a/gas/testsuite/gas/xtensa/loop-relax-2.d b/gas/testsuite/gas/xtensa/loop-relax-2.d
new file mode 100644
index 0000000..c0024bf
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/loop-relax-2.d
@@ -0,0 +1,7 @@
+#as: --text-section-literals
+#source: loop_align.s
+#objdump: -d
+
+#...
+.*loop.*a5,.*
+#...
diff --git a/gas/testsuite/gas/xtensa/loop-relax.d b/gas/testsuite/gas/xtensa/loop-relax.d
new file mode 100644
index 0000000..a5c8793
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/loop-relax.d
@@ -0,0 +1,14 @@
+#as:
+#objdump: -d
+
+#...
+.*loop.*a2,.*
+.*rsr.lend.*a2
+.*wsr.lbeg.*a2
+.*l32r.*a2,.*
+.*nop
+.*wsr.lend.*a2
+.*isync
+.*rsr.lcount.*a2
+.*addi.*a2, a2, 1
+#...
diff --git a/gas/testsuite/gas/xtensa/loop-relax.s b/gas/testsuite/gas/xtensa/loop-relax.s
new file mode 100644
index 0000000..26fbdd8
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/loop-relax.s
@@ -0,0 +1,58 @@
+foo = 0x12345678
+bar = 0x12345679
+baz = 0x1234567a
+qux = 0x1234567b
+
+	.text
+	.globl main
+	.align 4
+main:
+	entry   sp, 32
+	movi    a2, foo
+	movi    a3, bar
+	movi    a4, baz
+	movi    a5, qux
+	movi    a6, 0
+	movi    a7, 2
+
+	loop    a2, .Lloop_end
+	j       1f
+
+2:
+	movi    a2, 10
+	loop    a2, 3f
+	addi    a6, a6, 1
+3:
+	.rep 100
+	nop
+	.endr
+
+	movi    a2, 10
+	loop    a2, 3f
+	addi    a6, a6, 1
+3:
+	.rep 100
+	nop
+	.endr
+
+	.align  4
+	.literal_position
+1:
+	beqi    a6, 2, 2b
+	movi    a2, foo
+	movi    a3, bar
+	movi    a4, baz
+	movi    a5, qux
+
+	beqi    a6, 1, 1f
+
+	addi    a6, a6, 1
+.Lloop_end:
+
+	.rep    16
+	ill
+	.endr
+
+1:
+	movi    a2, 0
+	retw
diff --git a/gas/testsuite/gas/xtensa/text-section-literals-1a.d b/gas/testsuite/gas/xtensa/text-section-literals-1a.d
new file mode 100644
index 0000000..ca18e35
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/text-section-literals-1a.d
@@ -0,0 +1,18 @@
+#as: --auto-litpools
+#objdump: -d
+#source: text-section-literals-1.s
+
+.*: +file format .*xtensa.*
+#...
+Disassembly of section .init.literal:
+#...
+Disassembly of section .fini.literal:
+#...
+Disassembly of section .init:
+#...
+ *0:.*l32r.*
+#...
+Disassembly of section .fini:
+#...
+ *0:.*l32r.*
+#...
diff --git a/gas/testsuite/gas/xtensa/text-section-literals-2.d b/gas/testsuite/gas/xtensa/text-section-literals-2.d
new file mode 100644
index 0000000..c73c6b1
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/text-section-literals-2.d
@@ -0,0 +1,9 @@
+#as: --text-section-literals
+#objdump: -ds
+#Lone literal assembled successfully with --text-section-literals
+
+.*file format .*xtensa.*
+#...
+Contents of section .text:
+ 0000 12345678 .*
+#...
diff --git a/gas/testsuite/gas/xtensa/text-section-literals-2.s b/gas/testsuite/gas/xtensa/text-section-literals-2.s
new file mode 100644
index 0000000..2846b42
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/text-section-literals-2.s
@@ -0,0 +1,3 @@
+	.text
+
+	.literal .L0, 0x12345678
diff --git a/gas/testsuite/gas/xtensa/text-section-literals-2a.d b/gas/testsuite/gas/xtensa/text-section-literals-2a.d
new file mode 100644
index 0000000..9b91876
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/text-section-literals-2a.d
@@ -0,0 +1,10 @@
+#as: --auto-litpools
+#objdump: -ds
+#source: text-section-literals-2.s
+#Lone literal assembled successfully with --auto-litpools
+
+.*file format .*xtensa.*
+#...
+Contents of section .text:
+ 0000 12345678 .*
+#...
diff --git a/gas/testsuite/gas/xtensa/text-section-literals-3.d b/gas/testsuite/gas/xtensa/text-section-literals-3.d
new file mode 100644
index 0000000..b45a7e1
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/text-section-literals-3.d
@@ -0,0 +1,11 @@
+#as: --text-section-literals
+#objdump: -ds
+
+.*file format .*xtensa.*
+#...
+Contents of section .text:
+ 0000 12345678 .*
+#...
+00000004 <foo>:
+.*4:.*l32r.*a2, 0.*
+#...
diff --git a/gas/testsuite/gas/xtensa/text-section-literals-3.s b/gas/testsuite/gas/xtensa/text-section-literals-3.s
new file mode 100644
index 0000000..a3fad22
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/text-section-literals-3.s
@@ -0,0 +1,3 @@
+	.text
+foo:
+	movi	a2, 0x12345678
diff --git a/gas/testsuite/gas/xtensa/text-section-literals-4.d b/gas/testsuite/gas/xtensa/text-section-literals-4.d
new file mode 100644
index 0000000..f09a1f6
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/text-section-literals-4.d
@@ -0,0 +1,9 @@
+#as: --text-section-literals --longcalls
+#objdump: -d
+
+.*file format .*xtensa.*
+#...
+00000004 <foo>:
+.*4:.*l32r.*a0, 0 .*
+.*7:.*callx0.*a0
+#...
diff --git a/gas/testsuite/gas/xtensa/text-section-literals-4.s b/gas/testsuite/gas/xtensa/text-section-literals-4.s
new file mode 100644
index 0000000..57be3ac
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/text-section-literals-4.s
@@ -0,0 +1,3 @@
+	.text
+foo:
+	call0	bar
diff --git a/gas/testsuite/gas/xtensa/text-section-literals-4a.d b/gas/testsuite/gas/xtensa/text-section-literals-4a.d
new file mode 100644
index 0000000..64a186a
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/text-section-literals-4a.d
@@ -0,0 +1,10 @@
+#as: --auto-litpools --longcalls
+#objdump: -d
+#source: text-section-literals-4.s
+
+.*file format .*xtensa.*
+#...
+00000004 <foo>:
+.*4:.*l32r.*a0, 0 .*
+.*7:.*callx0.*a0
+#...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]