Skip to content

Commit 87b4d1d

Browse files
[AArch64][llvm] Unify AArch64 tests into a single file (1/4) (NFC)
This is a series of patches (1/4) to unify assembly/disassembly of recent AArch64 tests into a single file. The aim is to improve consistency, so that all instructions and system registers are thoroughly tested, and future test cases will be in a unified format. This patch: * unifies errorless .s and .txt tests into a single file * remove .txt tests which don't have feature requirements * makes the .s tests have a roundabout run line to test both encoding and assembly Co-authored-by: Virginia Cangelosi <virginia.cangelosi@arm.com>
1 parent a1d8331 commit 87b4d1d

22 files changed

+439
-327
lines changed

llvm/test/MC/AArch64/armv8.9a-ats1a.s

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
1-
// RUN: llvm-mc -triple aarch64 -show-encoding %s | FileCheck %s
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
4+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
5+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
6+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
7+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
8+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
9+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
10+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
11+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
12+
13+
214

315
at s1e1a, x1
4-
// CHECK: at s1e1a, x1 // encoding: [0x41,0x79,0x08,0xd5]
16+
// CHECK-INST: at s1e1a, x1
17+
// CHECK-ENCODING: encoding: [0x41,0x79,0x08,0xd5]
18+
// CHECK-UNKNOWN: d5087941 at s1e1a, x1
519

620
at s1e2a, x1
7-
// CHECK: at s1e2a, x1 // encoding: [0x41,0x79,0x0c,0xd5]
21+
// CHECK-INST: at s1e2a, x1
22+
// CHECK-ENCODING: encoding: [0x41,0x79,0x0c,0xd5]
23+
// CHECK-UNKNOWN: d50c7941 at s1e2a, x1
824

925
at s1e3a, x1
10-
// CHECK: at s1e3a, x1 // encoding: [0x41,0x79,0x0e,0xd5]
26+
// CHECK-INST: at s1e3a, x1
27+
// CHECK-ENCODING: encoding: [0x41,0x79,0x0e,0xd5]
28+
// CHECK-UNKNOWN: d50e7941 at s1e3a, x1

llvm/test/MC/AArch64/armv9.4a-ebep.s

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,39 @@
1-
// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
4+
// RUN: | llvm-objdump -d --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
5+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
6+
// RUN: | llvm-objdump -d --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
7+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
8+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
9+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
10+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
11+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
12+
13+
214

315
mrs x2, PM
16+
// CHECK-INST: mrs x2, PM
17+
// CHECK-ENCODING: encoding: [0x22,0x43,0x38,0xd5]
18+
// CHECK-UNKNOWN: d5384322 mrs x2, PM
19+
mrs x3, PM
20+
// CHECK-INST: mrs x3, PM
21+
// CHECK-ENCODING: encoding: [0x23,0x43,0x38,0xd5]
22+
// CHECK-UNKNOWN: d5384323 mrs x3, PM
423
msr PM, x3
24+
// CHECK-INST: msr PM, x3
25+
// CHECK-ENCODING: encoding: [0x23,0x43,0x18,0xd5]
26+
// CHECK-UNKNOWN: d5184323 msr PM, x3
27+
msr PM, x6
28+
// CHECK-INST: msr PM, x6
29+
// CHECK-ENCODING: encoding: [0x26,0x43,0x18,0xd5]
30+
// CHECK-UNKNOWN: d5184326 msr PM, x6
31+
msr PM, #0
32+
// CHECK-INST: msr PM, #0
33+
// CHECK-ENCODING: encoding: [0x1f,0x42,0x01,0xd5]
34+
// CHECK-UNKNOWN: d501421f msr PM, #0
535
msr PM, #1
36+
// CHECK-INST: msr PM, #1
37+
// CHECK-ENCODING: encoding: [0x1f,0x43,0x01,0xd5]
38+
// CHECK-UNKNOWN: d501431f msr PM, #1
639

7-
// CHECK: mrs x2, {{pm|PM}} // encoding: [0x22,0x43,0x38,0xd5]
8-
// CHECK: msr {{pm|PM}}, x3 // encoding: [0x23,0x43,0x18,0xd5]
9-
// CHECK: msr {{pm|PM}}, #1 // encoding: [0x1f,0x43,0x01,0xd5]

llvm/test/MC/AArch64/armv9.5a-e3dse.s

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
1-
// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
4+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
5+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
6+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
7+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
8+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
9+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
10+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
11+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
12+
13+
214

315
mrs x0, VDISR_EL3
4-
// CHECK: mrs x0, VDISR_EL3 // encoding: [0x20,0xc1,0x3e,0xd5]
16+
// CHECK-INST: mrs x0, VDISR_EL3
17+
// CHECK-ENCODING: encoding: [0x20,0xc1,0x3e,0xd5]
18+
// CHECK-UNKNOWN: d53ec120 mrs x0, VDISR_EL3
519

620
msr VDISR_EL3, x0
7-
// CHECK: msr VDISR_EL3, x0 // encoding: [0x20,0xc1,0x1e,0xd5]
21+
// CHECK-INST: msr VDISR_EL3, x0
22+
// CHECK-ENCODING: encoding: [0x20,0xc1,0x1e,0xd5]
23+
// CHECK-UNKNOWN: d51ec120 msr VDISR_EL3, x0
824

925
mrs x0, VSESR_EL3
10-
// CHECK: mrs x0, VSESR_EL3 // encoding: [0x60,0x52,0x3e,0xd5]
26+
// CHECK-INST: mrs x0, VSESR_EL3
27+
// CHECK-ENCODING: encoding: [0x60,0x52,0x3e,0xd5]
28+
// CHECK-UNKNOWN: d53e5260 mrs x0, VSESR_EL3
1129

1230
msr VSESR_EL3, x0
13-
// CHECK: msr VSESR_EL3, x0 // encoding: [0x60,0x52,0x1e,0xd5]
31+
// CHECK-INST: msr VSESR_EL3, x0
32+
// CHECK-ENCODING: encoding: [0x60,0x52,0x1e,0xd5]
33+
// CHECK-UNKNOWN: d51e5260 msr VSESR_EL3, x0
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1-
// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
4+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
5+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
6+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
7+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
8+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
9+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
10+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
11+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
12+
13+
214

315
mrs x0, FGWTE3_EL3
4-
// CHECK: mrs x0, FGWTE3_EL3 // encoding: [0xa0,0x11,0x3e,0xd5]
16+
// CHECK-INST: mrs x0, FGWTE3_EL3
17+
// CHECK-ENCODING: encoding: [0xa0,0x11,0x3e,0xd5]
18+
// CHECK-UNKNOWN: d53e11a0 mrs x0, FGWTE3_EL3
519
msr FGWTE3_EL3, x0
6-
// CHECK: msr FGWTE3_EL3, x0 // encoding: [0xa0,0x11,0x1e,0xd5]
20+
// CHECK-INST: msr FGWTE3_EL3, x0
21+
// CHECK-ENCODING: encoding: [0xa0,0x11,0x1e,0xd5]
22+
// CHECK-UNKNOWN: d51e11a0 msr FGWTE3_EL3, x0
Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
1-
// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
4+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
5+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
6+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
7+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
8+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
9+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
10+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
11+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
12+
13+
214

315
mrs x0, HACDBSBR_EL2
4-
// CHECK: mrs x0, HACDBSBR_EL2 // encoding: [0x80,0x23,0x3c,0xd5]
16+
// CHECK-INST: mrs x0, HACDBSBR_EL2
17+
// CHECK-ENCODING: encoding: [0x80,0x23,0x3c,0xd5]
18+
// CHECK-UNKNOWN: d53c2380 mrs x0, HACDBSBR_EL2
519
msr HACDBSBR_EL2, x0
6-
// CHECK: msr HACDBSBR_EL2, x0 // encoding: [0x80,0x23,0x1c,0xd5]
20+
// CHECK-INST: msr HACDBSBR_EL2, x0
21+
// CHECK-ENCODING: encoding: [0x80,0x23,0x1c,0xd5]
22+
// CHECK-UNKNOWN: d51c2380 msr HACDBSBR_EL2, x0
723

824
mrs x0, HACDBSCONS_EL2
9-
// CHECK: mrs x0, HACDBSCONS_EL2 // encoding: [0xa0,0x23,0x3c,0xd5]
25+
// CHECK-INST: mrs x0, HACDBSCONS_EL2
26+
// CHECK-ENCODING: encoding: [0xa0,0x23,0x3c,0xd5]
27+
// CHECK-UNKNOWN: d53c23a0 mrs x0, HACDBSCONS_EL2
1028
msr HACDBSCONS_EL2, x0
11-
// CHECK: msr HACDBSCONS_EL2, x0 // encoding: [0xa0,0x23,0x1c,0xd5]
29+
// CHECK-INST: msr HACDBSCONS_EL2, x0
30+
// CHECK-ENCODING: encoding: [0xa0,0x23,0x1c,0xd5]
31+
// CHECK-UNKNOWN: d51c23a0 msr HACDBSCONS_EL2, x0
1232

llvm/test/MC/AArch64/armv9.5a-hdbss.s

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
1-
// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
4+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
5+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
6+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
7+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
8+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
9+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
10+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
11+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
12+
13+
214

315
mrs x0, HDBSSBR_EL2
4-
// CHECK: mrs x0, HDBSSBR_EL2 // encoding: [0x40,0x23,0x3c,0xd5]
16+
// CHECK-INST: mrs x0, HDBSSBR_EL2
17+
// CHECK-ENCODING: encoding: [0x40,0x23,0x3c,0xd5]
18+
// CHECK-UNKNOWN: d53c2340 mrs x0, HDBSSBR_EL2
519
msr HDBSSBR_EL2, x0
6-
// CHECK: msr HDBSSBR_EL2, x0 // encoding: [0x40,0x23,0x1c,0xd5]
20+
// CHECK-INST: msr HDBSSBR_EL2, x0
21+
// CHECK-ENCODING: encoding: [0x40,0x23,0x1c,0xd5]
22+
// CHECK-UNKNOWN: d51c2340 msr HDBSSBR_EL2, x0
723

824
mrs x0, HDBSSPROD_EL2
9-
// CHECK: mrs x0, HDBSSPROD_EL2 // encoding: [0x60,0x23,0x3c,0xd5]
25+
// CHECK-INST: mrs x0, HDBSSPROD_EL2
26+
// CHECK-ENCODING: encoding: [0x60,0x23,0x3c,0xd5]
27+
// CHECK-UNKNOWN: d53c2360 mrs x0, HDBSSPROD_EL2
1028
msr HDBSSPROD_EL2, x0
11-
// CHECK: msr HDBSSPROD_EL2, x0 // encoding: [0x60,0x23,0x1c,0xd5]
29+
// CHECK-INST: msr HDBSSPROD_EL2, x0
30+
// CHECK-ENCODING: encoding: [0x60,0x23,0x1c,0xd5]
31+
// CHECK-UNKNOWN: d51c2360 msr HDBSSPROD_EL2, x0
1232

llvm/test/MC/AArch64/armv9.5a-spmu2.s

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
4+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
5+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
6+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
7+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
8+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
9+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
10+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
11+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
12+
13+
214

315
msr SPMZR_EL0, x0
4-
// CHECK: msr SPMZR_EL0, x0 // encoding: [0x80,0x9c,0x13,0xd5]
16+
// CHECK-INST: msr SPMZR_EL0, x0
17+
// CHECK-ENCODING: encoding: [0x80,0x9c,0x13,0xd5]
18+
// CHECK-UNKNOWN: d5139c80 msr SPMZR_EL0, x0

llvm/test/MC/AArch64/armv9.5a-step2.s

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1-
// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
4+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
5+
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
6+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
7+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
8+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
9+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
10+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
11+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
12+
13+
214

315
mrs x0, MDSTEPOP_EL1
4-
// CHECK: mrs x0, MDSTEPOP_EL1 // encoding: [0x40,0x05,0x30,0xd5]
16+
// CHECK-INST: mrs x0, MDSTEPOP_EL1
17+
// CHECK-ENCODING: encoding: [0x40,0x05,0x30,0xd5]
18+
// CHECK-UNKNOWN: d5300540 mrs x0, MDSTEPOP_EL1
519

620
msr MDSTEPOP_EL1, x0
7-
// CHECK: msr MDSTEPOP_EL1, x0 // encoding: [0x40,0x05,0x10,0xd5]
21+
// CHECK-INST: msr MDSTEPOP_EL1, x0
22+
// CHECK-ENCODING: encoding: [0x40,0x05,0x10,0xd5]
23+
// CHECK-UNKNOWN: d5100540 msr MDSTEPOP_EL1, x0

0 commit comments

Comments
 (0)