xref: /llvm-project/llvm/test/MC/AArch64/armv9.4a-chk.s (revision cb7fb737858cdfdc90406f9675c8470ea98417ed)
1// RUN: llvm-mc -triple aarch64 -mattr=+chk -show-encoding %s | FileCheck %s
2// RUN: llvm-mc -triple aarch64 -mattr=+v8.9a -show-encoding %s | FileCheck %s
3// RUN: llvm-mc -triple aarch64 -mattr=+v9.4a -show-encoding %s | FileCheck %s
4// RUN: llvm-mc -triple aarch64 -mattr=+v8a -show-encoding %s | FileCheck %s --check-prefix=NO-CHK
5
6// FEAT_CHK is mandatory from v8.0-a, but a clang user may not be using the LLVM
7// integrated assembler, so we cannot just print `chkfeat x16` in all
8// circumstances. Thankfully, we can always print `hint #40` when we cannot
9// print `chkfeat x16`.
10//
11// So, in this case, we only print `chkfeat x16` from v8.9-a onwards, as an
12// assembler that understands v8.9-a will understand `chkfeat x16`, and those
13// that understand previous versions may not.
14
15chkfeat x16
16// CHECK: chkfeat x16                       // encoding: [0x1f,0x25,0x03,0xd5]
17// NO-CHK: hint #40                              // encoding: [0x1f,0x25,0x03,0xd5]
18
19hint #40
20// CHECK: chkfeat x16                      // encoding: [0x1f,0x25,0x03,0xd5]
21// NO-CHK: hint #40                             // encoding: [0x1f,0x25,0x03,0xd5]
22