Skip to content

Commit be8bcde

Browse files
[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 0d63c4a commit be8bcde

13 files changed

+541
-590
lines changed

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

Lines changed: 117 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,117 @@
1-
// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+mec < %s | FileCheck %s
2-
// RUN: not llvm-mc -triple aarch64-none-linux-gnu < %s 2>&1 | FileCheck --check-prefix=CHECK-NO-MEC %s
3-
4-
mrs x0, MECIDR_EL2
5-
// CHECK: mrs x0, MECIDR_EL2 // encoding: [0xe0,0xa8,0x3c,0xd5]
6-
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
7-
mrs x0, MECID_P0_EL2
8-
// CHECK: mrs x0, MECID_P0_EL2 // encoding: [0x00,0xa8,0x3c,0xd5]
9-
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
10-
mrs x0, MECID_A0_EL2
11-
// CHECK: mrs x0, MECID_A0_EL2 // encoding: [0x20,0xa8,0x3c,0xd5]
12-
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
13-
mrs x0, MECID_P1_EL2
14-
// CHECK: mrs x0, MECID_P1_EL2 // encoding: [0x40,0xa8,0x3c,0xd5]
15-
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
16-
mrs x0, MECID_A1_EL2
17-
// CHECK: mrs x0, MECID_A1_EL2 // encoding: [0x60,0xa8,0x3c,0xd5]
18-
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
19-
mrs x0, VMECID_P_EL2
20-
// CHECK: mrs x0, VMECID_P_EL2 // encoding: [0x00,0xa9,0x3c,0xd5]
21-
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
22-
mrs x0, VMECID_A_EL2
23-
// CHECK: mrs x0, VMECID_A_EL2 // encoding: [0x20,0xa9,0x3c,0xd5]
24-
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
25-
mrs x0, MECID_RL_A_EL3
26-
// CHECK: mrs x0, MECID_RL_A_EL3 // encoding: [0x20,0xaa,0x3e,0xd5]
27-
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
28-
msr MECID_P0_EL2, x0
29-
// CHECK: msr MECID_P0_EL2, x0 // encoding: [0x00,0xa8,0x1c,0xd5]
30-
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
31-
msr MECID_A0_EL2, x0
32-
// CHECK: msr MECID_A0_EL2, x0 // encoding: [0x20,0xa8,0x1c,0xd5]
33-
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
34-
msr MECID_P1_EL2, x0
35-
// CHECK: msr MECID_P1_EL2, x0 // encoding: [0x40,0xa8,0x1c,0xd5]
36-
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
37-
msr MECID_A1_EL2, x0
38-
// CHECK: msr MECID_A1_EL2, x0 // encoding: [0x60,0xa8,0x1c,0xd5]
39-
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
40-
msr VMECID_P_EL2, x0
41-
// CHECK: msr VMECID_P_EL2, x0 // encoding: [0x00,0xa9,0x1c,0xd5]
42-
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
43-
msr VMECID_A_EL2, x0
44-
// CHECK: msr VMECID_A_EL2, x0 // encoding: [0x20,0xa9,0x1c,0xd5]
45-
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
46-
msr MECID_RL_A_EL3, x0
47-
// CHECK: msr MECID_RL_A_EL3, x0 // encoding: [0x20,0xaa,0x1e,0xd5]
48-
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
49-
50-
dc cigdpae, x0
51-
// CHECK: dc cigdpae, x0 // encoding: [0xe0,0x7e,0x0c,0xd5]
52-
// CHECK-NO-MEC: [[@LINE-2]]:14: error: DC CIGDPAE requires: mec
53-
dc cipae, x0
54-
// CHECK: dc cipae, x0 // encoding: [0x00,0x7e,0x0c,0xd5]
55-
// CHECK-NO-MEC: [[@LINE-2]]:14: error: DC CIPAE requires: mec
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+mec < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ERROR
5+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+mec < %s \
6+
// RUN: | llvm-objdump -d --mattr=+mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
7+
// 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
9+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
10+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+mec < %s \
11+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
12+
// RUN: | llvm-mc -triple=aarch64 -mattr=+mec -disassemble -show-encoding \
13+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
14+
15+
16+
17+
mrs x0, MECIDR_EL2
18+
// CHECK-INST: mrs x0, MECIDR_EL2
19+
// CHECK-ENCODING: encoding: [0xe0,0xa8,0x3c,0xd5]
20+
// CHECK-ERROR: error: expected readable system register
21+
// CHECK-UNKNOWN: d53ca8e0 mrs x0, S3_4_C10_C8_7
22+
23+
mrs x0, MECID_P0_EL2
24+
// CHECK-INST: mrs x0, MECID_P0_EL2
25+
// CHECK-ENCODING: encoding: [0x00,0xa8,0x3c,0xd5]
26+
// CHECK-ERROR: error: expected readable system register
27+
// CHECK-UNKNOWN: d53ca800 mrs x0, S3_4_C10_C8_0
28+
29+
mrs x0, MECID_A0_EL2
30+
// CHECK-INST: mrs x0, MECID_A0_EL2
31+
// CHECK-ENCODING: encoding: [0x20,0xa8,0x3c,0xd5]
32+
// CHECK-ERROR: error: expected readable system register
33+
// CHECK-UNKNOWN: d53ca820 mrs x0, S3_4_C10_C8_1
34+
35+
mrs x0, MECID_P1_EL2
36+
// CHECK-INST: mrs x0, MECID_P1_EL2
37+
// CHECK-ENCODING: encoding: [0x40,0xa8,0x3c,0xd5]
38+
// CHECK-ERROR: error: expected readable system register
39+
// CHECK-UNKNOWN: d53ca840 mrs x0, S3_4_C10_C8_2
40+
41+
mrs x0, MECID_A1_EL2
42+
// CHECK-INST: mrs x0, MECID_A1_EL2
43+
// CHECK-ENCODING: encoding: [0x60,0xa8,0x3c,0xd5]
44+
// CHECK-ERROR: error: expected readable system register
45+
// CHECK-UNKNOWN: d53ca860 mrs x0, S3_4_C10_C8_3
46+
47+
mrs x0, VMECID_P_EL2
48+
// CHECK-INST: mrs x0, VMECID_P_EL2
49+
// CHECK-ENCODING: encoding: [0x00,0xa9,0x3c,0xd5]
50+
// CHECK-ERROR: error: expected readable system register
51+
// CHECK-UNKNOWN: d53ca900 mrs x0, S3_4_C10_C9_0
52+
53+
mrs x0, VMECID_A_EL2
54+
// CHECK-INST: mrs x0, VMECID_A_EL2
55+
// CHECK-ENCODING: encoding: [0x20,0xa9,0x3c,0xd5]
56+
// CHECK-ERROR: error: expected readable system register
57+
// CHECK-UNKNOWN: d53ca920 mrs x0, S3_4_C10_C9_1
58+
59+
mrs x0, MECID_RL_A_EL3
60+
// CHECK-INST: mrs x0, MECID_RL_A_EL3
61+
// CHECK-ENCODING: encoding: [0x20,0xaa,0x3e,0xd5]
62+
// CHECK-ERROR: error: expected readable system register
63+
// CHECK-UNKNOWN: d53eaa20 mrs x0, S3_6_C10_C10_1
64+
65+
msr MECID_P0_EL2, x0
66+
// CHECK-INST: msr MECID_P0_EL2, x0
67+
// CHECK-ENCODING: encoding: [0x00,0xa8,0x1c,0xd5]
68+
// CHECK-ERROR: error: expected writable system register or pstate
69+
// CHECK-UNKNOWN: d51ca800 msr S3_4_C10_C8_0, x0
70+
71+
msr MECID_A0_EL2, x0
72+
// CHECK-INST: msr MECID_A0_EL2, x0
73+
// CHECK-ENCODING: encoding: [0x20,0xa8,0x1c,0xd5]
74+
// CHECK-ERROR: error: expected writable system register or pstate
75+
// CHECK-UNKNOWN: d51ca820 msr S3_4_C10_C8_1, x0
76+
77+
msr MECID_P1_EL2, x0
78+
// CHECK-INST: msr MECID_P1_EL2, x0
79+
// CHECK-ENCODING: encoding: [0x40,0xa8,0x1c,0xd5]
80+
// CHECK-ERROR: error: expected writable system register or pstate
81+
// CHECK-UNKNOWN: d51ca840 msr S3_4_C10_C8_2, x0
82+
83+
msr MECID_A1_EL2, x0
84+
// CHECK-INST: msr MECID_A1_EL2, x0
85+
// CHECK-ENCODING: encoding: [0x60,0xa8,0x1c,0xd5]
86+
// CHECK-ERROR: error: expected writable system register or pstate
87+
// CHECK-UNKNOWN: d51ca860 msr S3_4_C10_C8_3, x0
88+
89+
msr VMECID_P_EL2, x0
90+
// CHECK-INST: msr VMECID_P_EL2, x0
91+
// CHECK-ENCODING: encoding: [0x00,0xa9,0x1c,0xd5]
92+
// CHECK-ERROR: error: expected writable system register or pstate
93+
// CHECK-UNKNOWN: d51ca900 msr S3_4_C10_C9_0, x0
94+
95+
msr VMECID_A_EL2, x0
96+
// CHECK-INST: msr VMECID_A_EL2, x0
97+
// CHECK-ENCODING: encoding: [0x20,0xa9,0x1c,0xd5]
98+
// CHECK-ERROR: error: expected writable system register or pstate
99+
// CHECK-UNKNOWN: d51ca920 msr S3_4_C10_C9_1, x0
100+
101+
msr MECID_RL_A_EL3, x0
102+
// CHECK-INST: msr MECID_RL_A_EL3, x0
103+
// CHECK-ENCODING: encoding: [0x20,0xaa,0x1e,0xd5]
104+
// CHECK-ERROR: error: expected writable system register or pstate
105+
// CHECK-UNKNOWN: d51eaa20 msr S3_6_C10_C10_1, x0
106+
107+
dc cigdpae, x0
108+
// CHECK-INST: dc cigdpae, x0
109+
// CHECK-ENCODING: encoding: [0xe0,0x7e,0x0c,0xd5]
110+
// CHECK-ERROR: :[[@LINE-3]]:4: error: DC CIGDPAE requires: mec
111+
// CHECK-UNKNOWN: d50c7ee0 sys #4, c7, c14, #7, x0
112+
113+
dc cipae, x0
114+
// CHECK-INST: dc cipae, x0
115+
// CHECK-ENCODING: encoding: [0x00,0x7e,0x0c,0xd5]
116+
// CHECK-ERROR: :[[@LINE-3]]:4: error: DC CIPAE requires: mec
117+
// CHECK-UNKNOWN: d50c7e00 sys #4, c7, c14, #0, x0

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

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)