Skip to content

Commit 69452d5

Browse files
[AArch64][llvm] Unify AArch64 tests into a single file (1/4) (NFC) (#146328)
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 See also #146329, #146330 and #146331. --------- Co-authored-by: Virginia Cangelosi <[email protected]>
1 parent 9c361cc commit 69452d5

22 files changed

+469
-327
lines changed

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
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-prefixes=CHECK-UNKNOWN
5+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
6+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
7+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
8+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
9+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
10+
11+
212

313
at s1e1a, x1
4-
// CHECK: at s1e1a, x1 // encoding: [0x41,0x79,0x08,0xd5]
14+
// CHECK-INST: at s1e1a, x1
15+
// CHECK-ENCODING: encoding: [0x41,0x79,0x08,0xd5]
16+
// CHECK-UNKNOWN: d5087941 at s1e1a, x1
517

618
at s1e2a, x1
7-
// CHECK: at s1e2a, x1 // encoding: [0x41,0x79,0x0c,0xd5]
19+
// CHECK-INST: at s1e2a, x1
20+
// CHECK-ENCODING: encoding: [0x41,0x79,0x0c,0xd5]
21+
// CHECK-UNKNOWN: d50c7941 at s1e2a, x1
822

923
at s1e3a, x1
10-
// CHECK: at s1e3a, x1 // encoding: [0x41,0x79,0x0e,0xd5]
24+
// CHECK-INST: at s1e3a, x1
25+
// CHECK-ENCODING: encoding: [0x41,0x79,0x0e,0xd5]
26+
// CHECK-UNKNOWN: d50e7941 at s1e3a, x1

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

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,41 @@
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-UNKNOWN
5+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
6+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
7+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
8+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
9+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
10+
211

312
mrs x2, PM
13+
// CHECK-INST: mrs x2, PM
14+
// CHECK-ENCODING: encoding: [0x22,0x43,0x38,0xd5]
15+
// CHECK-UNKNOWN: d5384322 mrs x2, PM
16+
17+
mrs x3, PM
18+
// CHECK-INST: mrs x3, PM
19+
// CHECK-ENCODING: encoding: [0x23,0x43,0x38,0xd5]
20+
// CHECK-UNKNOWN: d5384323 mrs x3, PM
21+
422
msr PM, x3
23+
// CHECK-INST: msr PM, x3
24+
// CHECK-ENCODING: encoding: [0x23,0x43,0x18,0xd5]
25+
// CHECK-UNKNOWN: d5184323 msr PM, x3
26+
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+
32+
msr PM, #0
33+
// CHECK-INST: msr PM, #0
34+
// CHECK-ENCODING: encoding: [0x1f,0x42,0x01,0xd5]
35+
// CHECK-UNKNOWN: d501421f msr PM, #0
36+
537
msr PM, #1
38+
// CHECK-INST: msr PM, #1
39+
// CHECK-ENCODING: encoding: [0x1f,0x43,0x01,0xd5]
40+
// CHECK-UNKNOWN: d501431f msr PM, #1
641

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: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
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-UNKNOWN
5+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
6+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
7+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
8+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
9+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
10+
11+
212

313
mrs x0, VDISR_EL3
4-
// CHECK: mrs x0, VDISR_EL3 // encoding: [0x20,0xc1,0x3e,0xd5]
14+
// CHECK-INST: mrs x0, VDISR_EL3
15+
// CHECK-ENCODING: encoding: [0x20,0xc1,0x3e,0xd5]
16+
// CHECK-UNKNOWN: d53ec120 mrs x0, VDISR_EL3
517

618
msr VDISR_EL3, x0
7-
// CHECK: msr VDISR_EL3, x0 // encoding: [0x20,0xc1,0x1e,0xd5]
19+
// CHECK-INST: msr VDISR_EL3, x0
20+
// CHECK-ENCODING: encoding: [0x20,0xc1,0x1e,0xd5]
21+
// CHECK-UNKNOWN: d51ec120 msr VDISR_EL3, x0
822

923
mrs x0, VSESR_EL3
10-
// CHECK: mrs x0, VSESR_EL3 // encoding: [0x60,0x52,0x3e,0xd5]
24+
// CHECK-INST: mrs x0, VSESR_EL3
25+
// CHECK-ENCODING: encoding: [0x60,0x52,0x3e,0xd5]
26+
// CHECK-UNKNOWN: d53e5260 mrs x0, VSESR_EL3
1127

1228
msr VSESR_EL3, x0
13-
// CHECK: msr VSESR_EL3, x0 // encoding: [0x60,0x52,0x1e,0xd5]
29+
// CHECK-INST: msr VSESR_EL3, x0
30+
// CHECK-ENCODING: encoding: [0x60,0x52,0x1e,0xd5]
31+
// CHECK-UNKNOWN: d51e5260 msr VSESR_EL3, x0
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
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-UNKNOWN
5+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
6+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
7+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
8+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
9+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
10+
211

312
mrs x0, FGWTE3_EL3
4-
// CHECK: mrs x0, FGWTE3_EL3 // encoding: [0xa0,0x11,0x3e,0xd5]
13+
// CHECK-INST: mrs x0, FGWTE3_EL3
14+
// CHECK-ENCODING: encoding: [0xa0,0x11,0x3e,0xd5]
15+
// CHECK-UNKNOWN: d53e11a0 mrs x0, FGWTE3_EL3
16+
517
msr FGWTE3_EL3, x0
6-
// CHECK: msr FGWTE3_EL3, x0 // encoding: [0xa0,0x11,0x1e,0xd5]
18+
// CHECK-INST: msr FGWTE3_EL3, x0
19+
// CHECK-ENCODING: encoding: [0xa0,0x11,0x1e,0xd5]
20+
// CHECK-UNKNOWN: d51e11a0 msr FGWTE3_EL3, x0
Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
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-UNKNOWN
5+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
6+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
7+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
8+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
9+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
10+
211

312
mrs x0, HACDBSBR_EL2
4-
// CHECK: mrs x0, HACDBSBR_EL2 // encoding: [0x80,0x23,0x3c,0xd5]
13+
// CHECK-INST: mrs x0, HACDBSBR_EL2
14+
// CHECK-ENCODING: encoding: [0x80,0x23,0x3c,0xd5]
15+
// CHECK-UNKNOWN: d53c2380 mrs x0, HACDBSBR_EL2
16+
517
msr HACDBSBR_EL2, x0
6-
// CHECK: msr HACDBSBR_EL2, x0 // encoding: [0x80,0x23,0x1c,0xd5]
18+
// CHECK-INST: msr HACDBSBR_EL2, x0
19+
// CHECK-ENCODING: encoding: [0x80,0x23,0x1c,0xd5]
20+
// CHECK-UNKNOWN: d51c2380 msr HACDBSBR_EL2, x0
721

822
mrs x0, HACDBSCONS_EL2
9-
// CHECK: mrs x0, HACDBSCONS_EL2 // encoding: [0xa0,0x23,0x3c,0xd5]
23+
// CHECK-INST: mrs x0, HACDBSCONS_EL2
24+
// CHECK-ENCODING: encoding: [0xa0,0x23,0x3c,0xd5]
25+
// CHECK-UNKNOWN: d53c23a0 mrs x0, HACDBSCONS_EL2
26+
1027
msr HACDBSCONS_EL2, x0
11-
// CHECK: msr HACDBSCONS_EL2, x0 // encoding: [0xa0,0x23,0x1c,0xd5]
28+
// CHECK-INST: msr HACDBSCONS_EL2, x0
29+
// CHECK-ENCODING: encoding: [0xa0,0x23,0x1c,0xd5]
30+
// CHECK-UNKNOWN: d51c23a0 msr HACDBSCONS_EL2, x0
1231

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-UNKNOWN
5+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
6+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
7+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
8+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
9+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
10+
11+
212

313
mrs x0, HDBSSBR_EL2
4-
// CHECK: mrs x0, HDBSSBR_EL2 // encoding: [0x40,0x23,0x3c,0xd5]
14+
// CHECK-INST: mrs x0, HDBSSBR_EL2
15+
// CHECK-ENCODING: encoding: [0x40,0x23,0x3c,0xd5]
16+
// CHECK-UNKNOWN: d53c2340 mrs x0, HDBSSBR_EL2
17+
518
msr HDBSSBR_EL2, x0
6-
// CHECK: msr HDBSSBR_EL2, x0 // encoding: [0x40,0x23,0x1c,0xd5]
19+
// CHECK-INST: msr HDBSSBR_EL2, x0
20+
// CHECK-ENCODING: encoding: [0x40,0x23,0x1c,0xd5]
21+
// CHECK-UNKNOWN: d51c2340 msr HDBSSBR_EL2, x0
722

823
mrs x0, HDBSSPROD_EL2
9-
// CHECK: mrs x0, HDBSSPROD_EL2 // encoding: [0x60,0x23,0x3c,0xd5]
24+
// CHECK-INST: mrs x0, HDBSSPROD_EL2
25+
// CHECK-ENCODING: encoding: [0x60,0x23,0x3c,0xd5]
26+
// CHECK-UNKNOWN: d53c2360 mrs x0, HDBSSPROD_EL2
27+
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: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
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-UNKNOWN
5+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
6+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
7+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
8+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
9+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
10+
11+
212

313
msr SPMZR_EL0, x0
4-
// CHECK: msr SPMZR_EL0, x0 // encoding: [0x80,0x9c,0x13,0xd5]
14+
// CHECK-INST: msr SPMZR_EL0, x0
15+
// CHECK-ENCODING: encoding: [0x80,0x9c,0x13,0xd5]
16+
// CHECK-UNKNOWN: d5139c80 msr SPMZR_EL0, x0

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
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-UNKNOWN
5+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
6+
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
7+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
8+
// RUN: | llvm-mc -triple=aarch64 -disassemble -show-encoding \
9+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
10+
11+
212

313
mrs x0, MDSTEPOP_EL1
4-
// CHECK: mrs x0, MDSTEPOP_EL1 // encoding: [0x40,0x05,0x30,0xd5]
14+
// CHECK-INST: mrs x0, MDSTEPOP_EL1
15+
// CHECK-ENCODING: encoding: [0x40,0x05,0x30,0xd5]
16+
// CHECK-UNKNOWN: d5300540 mrs x0, MDSTEPOP_EL1
517

618
msr MDSTEPOP_EL1, x0
7-
// CHECK: msr MDSTEPOP_EL1, x0 // encoding: [0x40,0x05,0x10,0xd5]
19+
// CHECK-INST: msr MDSTEPOP_EL1, x0
20+
// CHECK-ENCODING: encoding: [0x40,0x05,0x10,0xd5]
21+
// CHECK-UNKNOWN: d5100540 msr MDSTEPOP_EL1, x0

0 commit comments

Comments
 (0)