This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH][GAS][ARM] Autodetection tests
- From: "Thomas Preud'homme" <thomas dot preudhomme at foss dot arm dot com>
- To: <binutils at sourceware dot org>
- Date: Thu, 17 Dec 2015 11:13:50 +0800
- Subject: [PATCH][GAS][ARM] Autodetection tests
- Authentication-results: sourceware.org; auth=none
[Sending on behalf of Andre Vieira]
Hi,
This patch adds tests for gas' auto detection by checking the build attributes assigned to object files. These should correspond to the instructions original source as per: 'ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition' found at: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0406c/index.html
This is correct because for these instructions, the architecture that first implements these is represented by the assigned build attributes. There are three exceptions here, CLREX, LDREXB and LDREXD. These instructions should be assigned attributes to represent ARMv7 and not ARMv6T2. The tests were left describing the current behavior, to detect any change, potentially pending a fix.
Tested by running GAS regressions.
Is this OK to commit?
Thanks,
Andre Vieira
gas/testsuite/ChangeLog:
2015-12-09 Andre Vieira <andre.simoesdiasvieira@arm.com>
* gas/arm/automatic-bw.d: New.
* gas/arm/automatic-bw.s: New.
* gas/arm/automatic-cbz.d: New.
* gas/arm/automatic-cbz.s: New.
* gas/arm/automatic-clrex.d: New.
* gas/arm/automatic-clrex.s: New.
* gas/arm/automatic-lda.d: New.
* gas/arm/automatic-lda.s: New.
* gas/arm/automatic-ldaex.d: New.
* gas/arm/automatic-ldaex.s: New.
* gas/arm/automatic-ldaexb.d: New.
* gas/arm/automatic-ldaexb.s: New.
* gas/arm/automatic-ldrex.d: New.
* gas/arm/automatic-ldrex.s: New.
* gas/arm/automatic-ldrexd.d: New.
* gas/arm/automatic-ldrexd.s: New.
* gas/arm/automatic-movw.d: New.
* gas/arm/automatic-movw.s: New.
* gas/arm/automatic-sdiv.d: New.
* gas/arm/automatic-sdiv.s: New.
* gas/arm/automatic-strexb.d: New.
* gas/arm/automatic-strexb.s: New.
From ddab751eec05ea1ac6408ee83bc891b32a76954f Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Wed, 9 Dec 2015 16:41:07 +0000
Subject: [PATCH] gas auto detection tests
---
gas/testsuite/gas/arm/automatic-bw.d | 8 ++++++++
gas/testsuite/gas/arm/automatic-bw.s | 3 +++
gas/testsuite/gas/arm/automatic-cbz.d | 8 ++++++++
gas/testsuite/gas/arm/automatic-cbz.s | 5 +++++
gas/testsuite/gas/arm/automatic-clrex.d | 8 ++++++++
gas/testsuite/gas/arm/automatic-clrex.s | 3 +++
gas/testsuite/gas/arm/automatic-lda.d | 9 +++++++++
gas/testsuite/gas/arm/automatic-lda.s | 3 +++
gas/testsuite/gas/arm/automatic-ldaex.d | 9 +++++++++
gas/testsuite/gas/arm/automatic-ldaex.s | 3 +++
gas/testsuite/gas/arm/automatic-ldaexb.d | 9 +++++++++
gas/testsuite/gas/arm/automatic-ldaexb.s | 3 +++
gas/testsuite/gas/arm/automatic-ldrex.d | 8 ++++++++
gas/testsuite/gas/arm/automatic-ldrex.s | 3 +++
gas/testsuite/gas/arm/automatic-ldrexd.d | 8 ++++++++
gas/testsuite/gas/arm/automatic-ldrexd.s | 3 +++
gas/testsuite/gas/arm/automatic-movw.d | 8 ++++++++
gas/testsuite/gas/arm/automatic-movw.s | 3 +++
gas/testsuite/gas/arm/automatic-sdiv.d | 9 +++++++++
gas/testsuite/gas/arm/automatic-sdiv.s | 3 +++
gas/testsuite/gas/arm/automatic-strexb.d | 8 ++++++++
gas/testsuite/gas/arm/automatic-strexb.s | 3 +++
22 files changed, 127 insertions(+)
create mode 100644 gas/testsuite/gas/arm/automatic-bw.d
create mode 100644 gas/testsuite/gas/arm/automatic-bw.s
create mode 100644 gas/testsuite/gas/arm/automatic-cbz.d
create mode 100644 gas/testsuite/gas/arm/automatic-cbz.s
create mode 100644 gas/testsuite/gas/arm/automatic-clrex.d
create mode 100644 gas/testsuite/gas/arm/automatic-clrex.s
create mode 100644 gas/testsuite/gas/arm/automatic-lda.d
create mode 100644 gas/testsuite/gas/arm/automatic-lda.s
create mode 100644 gas/testsuite/gas/arm/automatic-ldaex.d
create mode 100644 gas/testsuite/gas/arm/automatic-ldaex.s
create mode 100644 gas/testsuite/gas/arm/automatic-ldaexb.d
create mode 100644 gas/testsuite/gas/arm/automatic-ldaexb.s
create mode 100644 gas/testsuite/gas/arm/automatic-ldrex.d
create mode 100644 gas/testsuite/gas/arm/automatic-ldrex.s
create mode 100644 gas/testsuite/gas/arm/automatic-ldrexd.d
create mode 100644 gas/testsuite/gas/arm/automatic-ldrexd.s
create mode 100644 gas/testsuite/gas/arm/automatic-movw.d
create mode 100644 gas/testsuite/gas/arm/automatic-movw.s
create mode 100644 gas/testsuite/gas/arm/automatic-sdiv.d
create mode 100644 gas/testsuite/gas/arm/automatic-sdiv.s
create mode 100644 gas/testsuite/gas/arm/automatic-strexb.d
create mode 100644 gas/testsuite/gas/arm/automatic-strexb.s
diff --git a/gas/testsuite/gas/arm/automatic-bw.d b/gas/testsuite/gas/arm/automatic-bw.d
new file mode 100644
index 0000000000000000000000000000000000000000..d8cf54356d4f381d763f7df6b44406a5f5bf8718
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-bw.d
@@ -0,0 +1,8 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v6T2
+ Tag_THUMB_ISA_use: Thumb-2
+
diff --git a/gas/testsuite/gas/arm/automatic-bw.s b/gas/testsuite/gas/arm/automatic-bw.s
new file mode 100644
index 0000000000000000000000000000000000000000..1fdebe220462cc4f679d66790f7570f7f04d1609
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-bw.s
@@ -0,0 +1,3 @@
+.thumb
+.syntax unified
+b.w .L0
diff --git a/gas/testsuite/gas/arm/automatic-cbz.d b/gas/testsuite/gas/arm/automatic-cbz.d
new file mode 100644
index 0000000000000000000000000000000000000000..d8cf54356d4f381d763f7df6b44406a5f5bf8718
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-cbz.d
@@ -0,0 +1,8 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v6T2
+ Tag_THUMB_ISA_use: Thumb-2
+
diff --git a/gas/testsuite/gas/arm/automatic-cbz.s b/gas/testsuite/gas/arm/automatic-cbz.s
new file mode 100644
index 0000000000000000000000000000000000000000..523610ee5a977ed810c68572d6959e63c31068ff
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-cbz.s
@@ -0,0 +1,5 @@
+.thumb
+.syntax unified
+cbz r0, .L0
+nop
+.L0:
diff --git a/gas/testsuite/gas/arm/automatic-clrex.d b/gas/testsuite/gas/arm/automatic-clrex.d
new file mode 100644
index 0000000000000000000000000000000000000000..d8cf54356d4f381d763f7df6b44406a5f5bf8718
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-clrex.d
@@ -0,0 +1,8 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v6T2
+ Tag_THUMB_ISA_use: Thumb-2
+
diff --git a/gas/testsuite/gas/arm/automatic-clrex.s b/gas/testsuite/gas/arm/automatic-clrex.s
new file mode 100644
index 0000000000000000000000000000000000000000..d4e6a3632140fb35999b283b169d92ce8eddc4c3
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-clrex.s
@@ -0,0 +1,3 @@
+.thumb
+.syntax unified
+clrex
diff --git a/gas/testsuite/gas/arm/automatic-lda.d b/gas/testsuite/gas/arm/automatic-lda.d
new file mode 100644
index 0000000000000000000000000000000000000000..02bb7a48a9208538bde1fba580778a49a5fbfb83
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-lda.d
@@ -0,0 +1,9 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v8
+ Tag_CPU_arch_profile: Application
+ Tag_THUMB_ISA_use: Thumb-2
+
diff --git a/gas/testsuite/gas/arm/automatic-lda.s b/gas/testsuite/gas/arm/automatic-lda.s
new file mode 100644
index 0000000000000000000000000000000000000000..4c257e16f932773c829908d4b04154fe81d3ab05
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-lda.s
@@ -0,0 +1,3 @@
+.thumb
+.syntax unified
+lda r0, [r1]
diff --git a/gas/testsuite/gas/arm/automatic-ldaex.d b/gas/testsuite/gas/arm/automatic-ldaex.d
new file mode 100644
index 0000000000000000000000000000000000000000..02bb7a48a9208538bde1fba580778a49a5fbfb83
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-ldaex.d
@@ -0,0 +1,9 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v8
+ Tag_CPU_arch_profile: Application
+ Tag_THUMB_ISA_use: Thumb-2
+
diff --git a/gas/testsuite/gas/arm/automatic-ldaex.s b/gas/testsuite/gas/arm/automatic-ldaex.s
new file mode 100644
index 0000000000000000000000000000000000000000..c36e6fb06ead77a4bd717e6bbf70a7dd2833432d
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-ldaex.s
@@ -0,0 +1,3 @@
+.thumb
+.syntax unified
+ldaex r0, [r1]
diff --git a/gas/testsuite/gas/arm/automatic-ldaexb.d b/gas/testsuite/gas/arm/automatic-ldaexb.d
new file mode 100644
index 0000000000000000000000000000000000000000..02bb7a48a9208538bde1fba580778a49a5fbfb83
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-ldaexb.d
@@ -0,0 +1,9 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v8
+ Tag_CPU_arch_profile: Application
+ Tag_THUMB_ISA_use: Thumb-2
+
diff --git a/gas/testsuite/gas/arm/automatic-ldaexb.s b/gas/testsuite/gas/arm/automatic-ldaexb.s
new file mode 100644
index 0000000000000000000000000000000000000000..47459cc88d83de504da57c63b07c795f0e587944
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-ldaexb.s
@@ -0,0 +1,3 @@
+.thumb
+.syntax unified
+ldaexb r0, [r1]
diff --git a/gas/testsuite/gas/arm/automatic-ldrex.d b/gas/testsuite/gas/arm/automatic-ldrex.d
new file mode 100644
index 0000000000000000000000000000000000000000..d8cf54356d4f381d763f7df6b44406a5f5bf8718
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-ldrex.d
@@ -0,0 +1,8 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v6T2
+ Tag_THUMB_ISA_use: Thumb-2
+
diff --git a/gas/testsuite/gas/arm/automatic-ldrex.s b/gas/testsuite/gas/arm/automatic-ldrex.s
new file mode 100644
index 0000000000000000000000000000000000000000..9a51984f439540e4b5a347ba96ae3f9c9e4e2a13
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-ldrex.s
@@ -0,0 +1,3 @@
+.thumb
+.syntax unified
+ldrex r0, [r0]
diff --git a/gas/testsuite/gas/arm/automatic-ldrexd.d b/gas/testsuite/gas/arm/automatic-ldrexd.d
new file mode 100644
index 0000000000000000000000000000000000000000..d8cf54356d4f381d763f7df6b44406a5f5bf8718
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-ldrexd.d
@@ -0,0 +1,8 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v6T2
+ Tag_THUMB_ISA_use: Thumb-2
+
diff --git a/gas/testsuite/gas/arm/automatic-ldrexd.s b/gas/testsuite/gas/arm/automatic-ldrexd.s
new file mode 100644
index 0000000000000000000000000000000000000000..c6a728bc9e5aea66ebd3cfc5c777b10909777e98
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-ldrexd.s
@@ -0,0 +1,3 @@
+.thumb
+.syntax unified
+ldrexd r0, r1, [r2]
diff --git a/gas/testsuite/gas/arm/automatic-movw.d b/gas/testsuite/gas/arm/automatic-movw.d
new file mode 100644
index 0000000000000000000000000000000000000000..d8cf54356d4f381d763f7df6b44406a5f5bf8718
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-movw.d
@@ -0,0 +1,8 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v6T2
+ Tag_THUMB_ISA_use: Thumb-2
+
diff --git a/gas/testsuite/gas/arm/automatic-movw.s b/gas/testsuite/gas/arm/automatic-movw.s
new file mode 100644
index 0000000000000000000000000000000000000000..71fbd69d525d1e1976aac0a74a359295ae4e2d0a
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-movw.s
@@ -0,0 +1,3 @@
+.thumb
+.syntax unified
+movw r0, #65535
diff --git a/gas/testsuite/gas/arm/automatic-sdiv.d b/gas/testsuite/gas/arm/automatic-sdiv.d
new file mode 100644
index 0000000000000000000000000000000000000000..c2e5750e8f7200452761d125bd8ba1910b666e96
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-sdiv.d
@@ -0,0 +1,9 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v7
+ Tag_THUMB_ISA_use: Thumb-2
+ Tag_DIV_use: Allowed in v7-A with integer division extension
+
diff --git a/gas/testsuite/gas/arm/automatic-sdiv.s b/gas/testsuite/gas/arm/automatic-sdiv.s
new file mode 100644
index 0000000000000000000000000000000000000000..09957d875d320f62fdb3f9b666b017afb14eb5ab
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-sdiv.s
@@ -0,0 +1,3 @@
+.thumb
+.syntax unified
+sdiv r0, r0, r1
diff --git a/gas/testsuite/gas/arm/automatic-strexb.d b/gas/testsuite/gas/arm/automatic-strexb.d
new file mode 100644
index 0000000000000000000000000000000000000000..d8cf54356d4f381d763f7df6b44406a5f5bf8718
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-strexb.d
@@ -0,0 +1,8 @@
+# readelf: -A
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_arch: v6T2
+ Tag_THUMB_ISA_use: Thumb-2
+
diff --git a/gas/testsuite/gas/arm/automatic-strexb.s b/gas/testsuite/gas/arm/automatic-strexb.s
new file mode 100644
index 0000000000000000000000000000000000000000..480e52f4f2d82d98ab9cb4635d534d635acc988c
--- /dev/null
+++ b/gas/testsuite/gas/arm/automatic-strexb.s
@@ -0,0 +1,3 @@
+.thumb
+.syntax unified
+strexb r0, r1, [r2]
--
1.9.1