Skip to content

Commit 9b48b94

Browse files
fixup! [AArch64][llvm] Unify AArch64 tests into a single file (2/4) (NFC)
This is a series of patches (2/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: * removes .txt tests which have only one feature required * makes the .s tests have a roundabout run line to test both encoding and assembly * creates diagnostic tests when needed * fixes naming convention of tests Co-authored-by: Virginia Cangelosi <virginia.cangelosi@arm.com>
1 parent 1531a86 commit 9b48b94

File tree

6 files changed

+58
-7
lines changed

6 files changed

+58
-7
lines changed

llvm/test/MC/AArch64/armv9.2a-mec.s

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+mec < %s \
66
// RUN: | llvm-objdump -d --mattr=+mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
77
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+mec < %s \
8-
// RUN: | llvm-objdump -d --mattr=-mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
8+
// RUN: | llvm-objdump -d --mattr=-mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
99
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
1010
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+mec < %s \
1111
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
1212
// RUN: | llvm-mc -triple=aarch64 -mattr=+mec -disassemble -show-encoding \
1313
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
14-
14+
// RUN: llvm-mc -triple aarch64 -disassemble < %s 2>&1 | FileCheck --check-prefix=CHECK-NO-MEC %s
1515

1616

1717
mrs x0, MECIDR_EL2
@@ -109,9 +109,21 @@ dc cigdpae, x0
109109
// CHECK-ENCODING: encoding: [0xe0,0x7e,0x0c,0xd5]
110110
// CHECK-ERROR: :[[@LINE-3]]:4: error: DC CIGDPAE requires: mec
111111
// CHECK-UNKNOWN: d50c7ee0 sys #4, c7, c14, #7, x0
112+
// CHECK-NO-MEC: sys #4, c7, c14, #7, x0
112113

113114
dc cipae, x0
114115
// CHECK-INST: dc cipae, x0
115116
// CHECK-ENCODING: encoding: [0x00,0x7e,0x0c,0xd5]
116117
// CHECK-ERROR: :[[@LINE-3]]:4: error: DC CIPAE requires: mec
117118
// CHECK-UNKNOWN: d50c7e00 sys #4, c7, c14, #0, x0
119+
// CHECK-NO-MEC: sys #4, c7, c14, #0, x0
120+
121+
sys #4, c7, c14, #7, x0
122+
// CHECK-INST: dc cigdpae, x0
123+
// CHECK-ENCODING: encoding: [0xe0,0x7e,0x0c,0xd5]
124+
// CHECK-UNKNOWN: d50c7ee0 sys #4, c7, c14, #7, x0
125+
126+
sys #4, c7, c14, #0, x0
127+
// CHECK-INST: dc cipae, x0
128+
// CHECK-ENCODING: encoding: [0x00,0x7e,0x0c,0xd5]
129+
// CHECK-UNKNOWN: d50c7e00 sys #4, c7, c14, #0, x0

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+gcs < %s \
66
// RUN: | llvm-objdump -d --mattr=+gcs --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
77
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+gcs < %s \
8-
// RUN: | llvm-objdump -d --mattr=-gcs --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
8+
// RUN: | llvm-objdump -d --mattr=-gcs --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
99
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
1010
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+gcs < %s \
1111
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
1212
// RUN: | llvm-mc -triple=aarch64 -mattr=+gcs -disassemble -show-encoding \
1313
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
14-
14+
// RUN: not llvm-mc -triple aarch64 -show-encoding %s 2>%t | FileCheck %s --check-prefix=NO-GCS
1515

1616

1717
msr GCSCR_EL1, x0
@@ -154,11 +154,13 @@ gcsb dsync
154154
// CHECK-INST: gcsb dsync
155155
// CHECK-ENCODING: encoding: [0x7f,0x22,0x03,0xd5]
156156
// CHECK-UNKNOWN: d503227f hint #19
157+
// NO-GCS: hint #19 // encoding: [0x7f,0x22,0x03,0xd5]
157158

158159
hint #19
159160
// CHECK-INST: gcsb dsync
160161
// CHECK-ENCODING: encoding: [0x7f,0x22,0x03,0xd5]
161162
// CHECK-UNKNOWN: d503227f hint #19
163+
// NO-GCS: hint #19 // encoding: [0x7f,0x22,0x03,0xd5]
162164

163165
gcsstr x26, [x27]
164166
// CHECK-INST: gcsstr x26, [x27]

llvm/test/MC/AArch64/armv9.4a-lse128-diagnostics.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33

44
ldclrpl x22, xzr, [sp]
55
// CHECK-ERROR: error: invalid operand for instruction
6+
67
ldclrpl xzr, x22, [sp]
78
// CHECK-ERROR: error: invalid operand for instruction
89

910
ldsetpl x22, xzr, [sp]
1011
// CHECK-ERROR: error: invalid operand for instruction
12+
1113
ldsetpl xzr, x22, [sp]
1214
// CHECK-ERROR: error: invalid operand for instruction
1315

1416
swppl x22, xzr, [sp]
1517
// CHECK-ERROR: error: invalid operand for instruction
18+
1619
swppl xzr, x22, [sp]
1720
// CHECK-ERROR: error: invalid operand for instruction

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+lse128 < %s \
66
// RUN: | llvm-objdump -d --mattr=+lse128 - | FileCheck %s --check-prefix=CHECK-INST
77
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+lse128 < %s \
8-
// RUN: | llvm-objdump -d --mattr=-lse128 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
8+
// RUN: | llvm-objdump -d --mattr=-lse128 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
99
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
1010
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+lse128 < %s \
1111
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
@@ -19,36 +19,43 @@ ldclrp x1, x2, [x11]
1919
// CHECK-ENCODING: encoding: [0x61,0x11,0x22,0x19]
2020
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
2121
// CHECK-UNKNOWN: 19221161 <unknown>
22+
2223
ldclrp x21, x22, [sp]
2324
// CHECK-INST: ldclrp x21, x22, [sp]
2425
// CHECK-ENCODING: encoding: [0xf5,0x13,0x36,0x19]
2526
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
2627
// CHECK-UNKNOWN: 193613f5 <unknown>
28+
2729
ldclrpa x1, x2, [x11]
2830
// CHECK-INST: ldclrpa x1, x2, [x11]
2931
// CHECK-ENCODING: encoding: [0x61,0x11,0xa2,0x19]
3032
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
3133
// CHECK-UNKNOWN: 19a21161 <unknown>
34+
3235
ldclrpa x21, x22, [sp]
3336
// CHECK-INST: ldclrpa x21, x22, [sp]
3437
// CHECK-ENCODING: encoding: [0xf5,0x13,0xb6,0x19]
3538
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
3639
// CHECK-UNKNOWN: 19b613f5 <unknown>
40+
3741
ldclrpal x1, x2, [x11]
3842
// CHECK-INST: ldclrpal x1, x2, [x11]
3943
// CHECK-ENCODING: encoding: [0x61,0x11,0xe2,0x19]
4044
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
4145
// CHECK-UNKNOWN: 19e21161 <unknown>
46+
4247
ldclrpal x21, x22, [sp]
4348
// CHECK-INST: ldclrpal x21, x22, [sp]
4449
// CHECK-ENCODING: encoding: [0xf5,0x13,0xf6,0x19]
4550
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
4651
// CHECK-UNKNOWN: 19f613f5 <unknown>
52+
4753
ldclrpl x1, x2, [x11]
4854
// CHECK-INST: ldclrpl x1, x2, [x11]
4955
// CHECK-ENCODING: encoding: [0x61,0x11,0x62,0x19]
5056
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
5157
// CHECK-UNKNOWN: 19621161 <unknown>
58+
5259
ldclrpl x21, x22, [sp]
5360
// CHECK-INST: ldclrpl x21, x22, [sp]
5461
// CHECK-ENCODING: encoding: [0xf5,0x13,0x76,0x19]
@@ -60,36 +67,43 @@ ldsetp x1, x2, [x11]
6067
// CHECK-ENCODING: encoding: [0x61,0x31,0x22,0x19]
6168
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
6269
// CHECK-UNKNOWN: 19223161 <unknown>
70+
6371
ldsetp x21, x22, [sp]
6472
// CHECK-INST: ldsetp x21, x22, [sp]
6573
// CHECK-ENCODING: encoding: [0xf5,0x33,0x36,0x19]
6674
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
6775
// CHECK-UNKNOWN: 193633f5 <unknown>
76+
6877
ldsetpa x1, x2, [x11]
6978
// CHECK-INST: ldsetpa x1, x2, [x11]
7079
// CHECK-ENCODING: encoding: [0x61,0x31,0xa2,0x19]
7180
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
7281
// CHECK-UNKNOWN: 19a23161 <unknown>
82+
7383
ldsetpa x21, x22, [sp]
7484
// CHECK-INST: ldsetpa x21, x22, [sp]
7585
// CHECK-ENCODING: encoding: [0xf5,0x33,0xb6,0x19]
7686
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
7787
// CHECK-UNKNOWN: 19b633f5 <unknown>
88+
7889
ldsetpal x1, x2, [x11]
7990
// CHECK-INST: ldsetpal x1, x2, [x11]
8091
// CHECK-ENCODING: encoding: [0x61,0x31,0xe2,0x19]
8192
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
8293
// CHECK-UNKNOWN: 19e23161 <unknown>
94+
8395
ldsetpal x21, x22, [sp]
8496
// CHECK-INST: ldsetpal x21, x22, [sp]
8597
// CHECK-ENCODING: encoding: [0xf5,0x33,0xf6,0x19]
8698
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
8799
// CHECK-UNKNOWN: 19f633f5 <unknown>
100+
88101
ldsetpl x1, x2, [x11]
89102
// CHECK-INST: ldsetpl x1, x2, [x11]
90103
// CHECK-ENCODING: encoding: [0x61,0x31,0x62,0x19]
91104
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
92105
// CHECK-UNKNOWN: 19623161 <unknown>
106+
93107
ldsetpl x21, x22, [sp]
94108
// CHECK-INST: ldsetpl x21, x22, [sp]
95109
// CHECK-ENCODING: encoding: [0xf5,0x33,0x76,0x19]
@@ -101,36 +115,43 @@ swpp x1, x2, [x11]
101115
// CHECK-ENCODING: encoding: [0x61,0x81,0x22,0x19]
102116
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
103117
// CHECK-UNKNOWN: 19228161 <unknown>
118+
104119
swpp x21, x22, [sp]
105120
// CHECK-INST: swpp x21, x22, [sp]
106121
// CHECK-ENCODING: encoding: [0xf5,0x83,0x36,0x19]
107122
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
108123
// CHECK-UNKNOWN: 193683f5 <unknown>
124+
109125
swppa x1, x2, [x11]
110126
// CHECK-INST: swppa x1, x2, [x11]
111127
// CHECK-ENCODING: encoding: [0x61,0x81,0xa2,0x19]
112128
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
113129
// CHECK-UNKNOWN: 19a28161 <unknown>
130+
114131
swppa x21, x22, [sp]
115132
// CHECK-INST: swppa x21, x22, [sp]
116133
// CHECK-ENCODING: encoding: [0xf5,0x83,0xb6,0x19]
117134
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
118135
// CHECK-UNKNOWN: 19b683f5 <unknown>
136+
119137
swppal x1, x2, [x11]
120138
// CHECK-INST: swppal x1, x2, [x11]
121139
// CHECK-ENCODING: encoding: [0x61,0x81,0xe2,0x19]
122140
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
123141
// CHECK-UNKNOWN: 19e28161 <unknown>
142+
124143
swppal x21, x22, [sp]
125144
// CHECK-INST: swppal x21, x22, [sp]
126145
// CHECK-ENCODING: encoding: [0xf5,0x83,0xf6,0x19]
127146
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
128147
// CHECK-UNKNOWN: 19f683f5 <unknown>
148+
129149
swppl x1, x2, [x11]
130150
// CHECK-INST: swppl x1, x2, [x11]
131151
// CHECK-ENCODING: encoding: [0x61,0x81,0x62,0x19]
132152
// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
133153
// CHECK-UNKNOWN: 19628161 <unknown>
154+
134155
swppl x21, x22, [sp]
135156
// CHECK-INST: swppl x21, x22, [sp]
136157
// CHECK-ENCODING: encoding: [0xf5,0x83,0x76,0x19]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+cpa < %s \
66
// RUN: | llvm-objdump -d --mattr=+cpa - | FileCheck %s --check-prefix=CHECK-INST
77
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+cpa < %s \
8-
// RUN: | llvm-objdump -d --mattr=-cpa - | FileCheck %s --check-prefix=CHECK-UNKNOWN
8+
// RUN: | llvm-objdump -d --mattr=-cpa - | FileCheck %s --check-prefix=CHECK-UNKNOWN
99
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
1010
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+cpa < %s \
1111
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \

llvm/test/MC/AArch64/armv9.6a-mpam.s

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
44
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
55
// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
6-
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
6+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
77
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
88
// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
99
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
@@ -20,26 +20,32 @@ msr MPAMBW3_EL3, x0
2020
// CHECK-INST: msr MPAMBW3_EL3, x0
2121
// CHECK-ENCODING: encoding: [0x80,0xa5,0x1e,0xd5]
2222
// CHECK-UNKNOWN: d51ea580 msr MPAMBW3_EL3, x0
23+
2324
msr MPAMBW2_EL2, x0
2425
// CHECK-INST: msr MPAMBW2_EL2, x0
2526
// CHECK-ENCODING: encoding: [0x80,0xa5,0x1c,0xd5]
2627
// CHECK-UNKNOWN: d51ca580 msr MPAMBW2_EL2, x0
28+
2729
msr MPAMBW1_EL1, x0
2830
// CHECK-INST: msr MPAMBW1_EL1, x0
2931
// CHECK-ENCODING: encoding: [0x80,0xa5,0x18,0xd5]
3032
// CHECK-UNKNOWN: d518a580 msr MPAMBW1_EL1, x0
33+
3134
msr MPAMBW1_EL12, x0
3235
// CHECK-INST: msr MPAMBW1_EL12, x0
3336
// CHECK-ENCODING: encoding: [0x80,0xa5,0x1d,0xd5]
3437
// CHECK-UNKNOWN: d51da580 msr MPAMBW1_EL12, x0
38+
3539
msr MPAMBW0_EL1, x0
3640
// CHECK-INST: msr MPAMBW0_EL1, x0
3741
// CHECK-ENCODING: encoding: [0xa0,0xa5,0x18,0xd5]
3842
// CHECK-UNKNOWN: d518a5a0 msr MPAMBW0_EL1, x0
43+
3944
msr MPAMBWCAP_EL2, x0
4045
// CHECK-INST: msr MPAMBWCAP_EL2, x0
4146
// CHECK-ENCODING: encoding: [0xc0,0xa5,0x1c,0xd5]
4247
// CHECK-UNKNOWN: d51ca5c0 msr MPAMBWCAP_EL2, x0
48+
4349
msr MPAMBWSM_EL1, x0
4450
// CHECK-INST: msr MPAMBWSM_EL1, x0
4551
// CHECK-ENCODING: encoding: [0xe0,0xa5,0x18,0xd5]
@@ -49,30 +55,37 @@ mrs x0, MPAMBWIDR_EL1
4955
// CHECK-INST: mrs x0, MPAMBWIDR_EL1
5056
// CHECK-ENCODING: encoding: [0xa0,0xa4,0x38,0xd5]
5157
// CHECK-UNKNOWN: d538a4a0 mrs x0, MPAMBWIDR_EL1
58+
5259
mrs x0, MPAMBW3_EL3
5360
// CHECK-INST: mrs x0, MPAMBW3_EL3
5461
// CHECK-ENCODING: encoding: [0x80,0xa5,0x3e,0xd5]
5562
// CHECK-UNKNOWN: d53ea580 mrs x0, MPAMBW3_EL3
63+
5664
mrs x0, MPAMBW2_EL2
5765
// CHECK-INST: mrs x0, MPAMBW2_EL2
5866
// CHECK-ENCODING: encoding: [0x80,0xa5,0x3c,0xd5]
5967
// CHECK-UNKNOWN: d53ca580 mrs x0, MPAMBW2_EL2
68+
6069
mrs x0, MPAMBW1_EL1
6170
// CHECK-INST: mrs x0, MPAMBW1_EL1
6271
// CHECK-ENCODING: encoding: [0x80,0xa5,0x38,0xd5]
6372
// CHECK-UNKNOWN: d538a580 mrs x0, MPAMBW1_EL1
73+
6474
mrs x0, MPAMBW1_EL12
6575
// CHECK-INST: mrs x0, MPAMBW1_EL12
6676
// CHECK-ENCODING: encoding: [0x80,0xa5,0x3d,0xd5]
6777
// CHECK-UNKNOWN: d53da580 mrs x0, MPAMBW1_EL12
78+
6879
mrs x0, MPAMBW0_EL1
6980
// CHECK-INST: mrs x0, MPAMBW0_EL1
7081
// CHECK-ENCODING: encoding: [0xa0,0xa5,0x38,0xd5]
7182
// CHECK-UNKNOWN: d538a5a0 mrs x0, MPAMBW0_EL1
83+
7284
mrs x0, MPAMBWCAP_EL2
7385
// CHECK-INST: mrs x0, MPAMBWCAP_EL2
7486
// CHECK-ENCODING: encoding: [0xc0,0xa5,0x3c,0xd5]
7587
// CHECK-UNKNOWN: d53ca5c0 mrs x0, MPAMBWCAP_EL2
88+
7689
mrs x0, MPAMBWSM_EL1
7790
// CHECK-INST: mrs x0, MPAMBWSM_EL1
7891
// CHECK-ENCODING: encoding: [0xe0,0xa5,0x38,0xd5]

0 commit comments

Comments
 (0)