Skip to content

Commit 651f763

Browse files
[AArch64][llvm] Unify AArch64 tests into a single file (4/4) (NFC)
This is a series of patches (4/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 whose .s tests have functions * 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 c2e7b56 commit 651f763

File tree

8 files changed

+805
-765
lines changed

8 files changed

+805
-765
lines changed

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

Lines changed: 708 additions & 365 deletions
Large diffs are not rendered by default.

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

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,39 @@
1-
// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+occmo -mattr=+mte %s | FileCheck %s
2-
// RUN: not llvm-mc -triple aarch64-none-linux-gnu -show-encoding %s -mattr=+mte 2>&1 | FileCheck --check-prefix=ERROR %s
3-
.func:
4-
// CHECK: .func:
5-
dc civaoc, x12
6-
// CHECK: dc civaoc, x12 // encoding: [0x0c,0x7f,0x0b,0xd5]
7-
// ERROR: error: DC CIVAOC requires: occmo
8-
dc cigdvaoc, x0
9-
// CHECK: dc cigdvaoc, x0 // encoding: [0xe0,0x7f,0x0b,0xd5]
10-
// ERROR: error: DC CIGDVAOC requires: mte, memtag, occmo
11-
dc cvaoc, x13
12-
// CHECK: dc cvaoc, x13 // encoding: [0x0d,0x7b,0x0b,0xd5]
13-
// ERROR: error: DC CVAOC requires: occmo
14-
dc cgdvaoc, x1
15-
// CHECK: dc cgdvaoc, x1 // encoding: [0xe1,0x7b,0x0b,0xd5]
16-
// ERROR: error: DC CGDVAOC requires: mte, memtag, occmo
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+occmo,+mte,+memtag < %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=+occmo,+mte,+memtag < %s \
6+
// RUN: | llvm-objdump -d --mattr=+occmo,+mte,+memtag --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
7+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+occmo,+mte,+memtag < %s \
8+
// RUN: | llvm-objdump -d --mattr=-occmo,-mte,-memtag --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=+occmo,+mte,+memtag < %s \
11+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
12+
// RUN: | llvm-mc -triple=aarch64 -mattr=+occmo,+mte,+memtag -disassemble -show-encoding \
13+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
1714

15+
16+
17+
dc civaoc, x12
18+
// CHECK-INST: dc civaoc, x12
19+
// CHECK-ENCODING: encoding: [0x0c,0x7f,0x0b,0xd5]
20+
// CHECK-ERROR: error: DC CIVAOC requires: occmo
21+
// CHECK-UNKNOWN: d50b7f0c sys #3, c7, c15, #0, x12
22+
dc cigdvaoc, x0
23+
// CHECK-INST: dc cigdvaoc, x0
24+
// CHECK-ENCODING: encoding: [0xe0,0x7f,0x0b,0xd5]
25+
// CHECK-ERROR: error: DC CIGDVAOC requires: mte, memtag, occmo
26+
// CHECK-UNKNOWN: d50b7fe0 sys #3, c7, c15, #7, x0
27+
// ERROR: :[[@LINE-3]]:4: error: DC CIGDVAOC requires: mte, memtag, occmo
28+
dc cvaoc, x13
29+
// CHECK-INST: dc cvaoc, x13
30+
// CHECK-ENCODING: encoding: [0x0d,0x7b,0x0b,0xd5]
31+
// CHECK-ERROR: error: DC CVAOC requires: occmo
32+
// CHECK-UNKNOWN: d50b7b0d sys #3, c7, c11, #0, x13
33+
// ERROR: :[[@LINE-3]]:4: error: DC CVAOC requires: occmo
34+
dc cgdvaoc, x1
35+
// CHECK-INST: dc cgdvaoc, x1
36+
// CHECK-ENCODING: encoding: [0xe1,0x7b,0x0b,0xd5]
37+
// CHECK-ERROR: error: DC CGDVAOC requires: mte, memtag, occmo
38+
// CHECK-UNKNOWN: d50b7be1 sys #3, c7, c11, #7, x1
39+
// ERROR: :[[@LINE-3]]:4: error: DC CGDVAOC requires: mte, memtag, occmo
Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
// RUN: llvm-mc -triple aarch64 -show-encoding -mattr=+pcdphint %s | FileCheck %s
2-
// RUN: not llvm-mc -triple aarch64-none-linux-gnu -show-encoding %s 2>&1 | FileCheck --check-prefix=ERROR %s
3-
4-
.func:
5-
// CHECK: .func:
6-
stshh keep
7-
// CHECK: stshh keep // encoding: [0x1f,0x96,0x01,0xd5]
8-
// ERROR: error: instruction requires: pcdphint
9-
stshh strm
10-
// CHECK: stshh strm // encoding: [0x3f,0x96,0x01,0xd5]
11-
// ERROR: error: instruction requires: pcdphint
12-
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+pcdphint < %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=+pcdphint < %s \
6+
// RUN: | llvm-objdump -d --mattr=+pcdphint - | FileCheck %s --check-prefix=CHECK-INST
7+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+pcdphint < %s \
8+
// RUN: | llvm-objdump -d --mattr=-pcdphint - | 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=+pcdphint < %s \
11+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
12+
// RUN: | llvm-mc -triple=aarch64 -mattr=+pcdphint -disassemble -show-encoding \
13+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
1314

15+
stshh keep
16+
// CHECK-INST: stshh keep
17+
// CHECK-ENCODING: encoding: [0x1f,0x96,0x01,0xd5]
18+
// CHECK-ERROR: error: instruction requires: pcdphint
19+
// CHECK-UNKNOWN: d501961f msr S0_1_C9_C6_0, xzr
20+
// ERROR: :[[@LINE-3]]:3: error: instruction requires: pcdphint
21+
stshh strm
22+
// CHECK-INST: stshh strm
23+
// CHECK-ENCODING: encoding: [0x3f,0x96,0x01,0xd5]
24+
// CHECK-ERROR: error: instruction requires: pcdphint
25+
// CHECK-UNKNOWN: d501963f msr S0_1_C9_C6_1, xzr
26+
// ERROR: :[[@LINE-3]]:3: error: instruction requires: pcdphint
Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,41 @@
1-
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
2-
// RUN: llvm-mc -triple aarch64 -show-encoding %s | FileCheck %s
3-
.func:
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+
414
apas x0
15+
// CHECK-INST: apas x0
16+
// CHECK-ENCODING: encoding: [0x00,0x70,0x0e,0xd5]
17+
// CHECK-UNKNOWN: d50e7000 apas x0
518
apas x1
19+
// CHECK-INST: apas x1
20+
// CHECK-ENCODING: encoding: [0x01,0x70,0x0e,0xd5]
21+
// CHECK-UNKNOWN: d50e7001 apas x1
622
apas x2
23+
// CHECK-INST: apas x2
24+
// CHECK-ENCODING: encoding: [0x02,0x70,0x0e,0xd5]
25+
// CHECK-UNKNOWN: d50e7002 apas x2
726
apas x17
27+
// CHECK-INST: apas x17
28+
// CHECK-ENCODING: encoding: [0x11,0x70,0x0e,0xd5]
29+
// CHECK-UNKNOWN: d50e7011 apas x17
830
apas x30
31+
// CHECK-INST: apas x30
32+
// CHECK-ENCODING: encoding: [0x1e,0x70,0x0e,0xd5]
33+
// CHECK-UNKNOWN: d50e701e apas x30
934
mrs x3, GPCBW_EL3
35+
// CHECK-INST: mrs x3, GPCBW_EL3
36+
// CHECK-ENCODING: encoding: [0xa3,0x21,0x3e,0xd5]
37+
// CHECK-UNKNOWN: d53e21a3 mrs x3, GPCBW_EL3
1038
msr GPCBW_EL3, x4
11-
12-
# CHECK: .func:
13-
# CHECK-NEXT: apas x0 // encoding: [0x00,0x70,0x0e,0xd5]
14-
# CHECK-NEXT: apas x1 // encoding: [0x01,0x70,0x0e,0xd5]
15-
# CHECK-NEXT: apas x2 // encoding: [0x02,0x70,0x0e,0xd5]
16-
# CHECK-NEXT: apas x17 // encoding: [0x11,0x70,0x0e,0xd5]
17-
# CHECK-NEXT: apas x30 // encoding: [0x1e,0x70,0x0e,0xd5]
18-
# CHECK-NEXT: mrs x3, GPCBW_EL3 // encoding: [0xa3,0x21,0x3e,0xd5]
19-
# CHECK-NEXT: msr GPCBW_EL3, x4 // encoding: [0xa4,0x21,0x1e,0xd5]
39+
// CHECK-INST: msr GPCBW_EL3, x4
40+
// CHECK-ENCODING: encoding: [0xa4,0x21,0x1e,0xd5]
41+
// CHECK-UNKNOWN: d51e21a4 msr GPCBW_EL3, x4

0 commit comments

Comments
 (0)