// RUN: not llvm-mc -triple=thumbv8m.main -mattr=+cdecp0 -mattr=+cdecp1 -show-encoding < %s 2>%t | FileCheck %s
// RUN: FileCheck <%t --check-prefix=ERROR %s
// CHECK-LABEL: test_gcp
test_gcp:
// CHECK-NEXT: mrc p3, mrc p3, // CHECK-NEXT: mcr2 p3, mcr2 p3,
// ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
mrc p0, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
ldc2 p1, c8, [r1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
ldc2 p0, c7, [r2]
// ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
ldc2 p1, c6, [r3, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
ldc2 p0, c5, [r4, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
ldc2l p1, c2, [r7, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
ldc2l p0, c1, [r8]
// ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
ldc2l p1, c0, [r9, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
ldc2l p0, c1, [r10, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
stc2 p1, c8, [r1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
stc2 p0, c7, [r2]
// ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
stc2 p1, c6, [r3, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
stc2 p0, c5, [r4, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
stc2l p1, c2, [r7, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
stc2l p0, c1, [r8]
// ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
stc2l p1, c0, [r9, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as GCP
stc2l p0, c1, [r10,
// CHECK-LABEL: test_predication1:
test_predication1:
ittt eq
// ERROR: [[@LINE+1]]:{{[0-9]+}}: error: instructions in IT block must be predicable
cx1 p0, r3, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: instructions in IT block must be predicable
cx2 p0, r2, r3, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: instructions in IT block must be predicable
cx3 p0, r1, r5, r7, nop
nop
nop
ittt eq
// ERROR: [[@LINE+1]]:{{[0-9]+}}: error: instructions in IT block must be predicable
cx1d p0, r0, r1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: instructions in IT block must be predicable
cx2d p0, r0, r1, r3, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: instructions in IT block must be predicable
cx3d p0, r0, r1, r5, r7, nop
nop
nop
// CHECK-LABEL: test_predication2:
test_predication2:
// CHECK: itte eq @ encoding: [0x06,0xbf]
itte eq
// CHECK-NEXT: cx1aeq p0, r3, cx1aeq p0, r3, // CHECK-NEXT: cx2aeq p0, r2, r3, cx2aeq p0, r2, r3, // CHECK-NEXT: cx3ane p0, r1, r5, r7, cx3ane p0, r1, r5, r7, // CHECK-NEXT: itte eq @ encoding: [0x06,0xbf]
itte eq
// CHECK-NEXT: cx1daeq p0, r0, r1, cx1daeq p0, r0, r1, // CHECK-NEXT: cx2daeq p0, r0, r1, r3, cx2daeq p0, r0, r1, r3, // CHECK-NEXT: cx3dane p0, r0, r1, r5, r7, cx3dane p0, r0, r1, r5, r7,
// CHECK-LABEL: test_cx1:
test_cx1:
// CHECK-NEXT: cx1 p0, r3, cx1 p0, r3, // CHECK-NEXT: cx1a p1, r2, cx1a p1, r2, // CHECK-NEXT: cx1d p0, r4, r5, cx1d p0, r4, r5, // CHECK-NEXT: cx1da p1, r2, r3, cx1da p1, r2, r3, // CHECK-NEXT: cx1 p0, apsr_nzcv, cx1 p0, apsr_nzcv, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be in the range [p0, p7]
cx1 p8, r1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: coprocessor must be configured as CDE
cx1 p2, r0, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be an immediate in the range [0,8191]
cx1 p0, r1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be a register in the range [r0, r12], r14 or apsr_nzcv
cx1 p0, r13, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be a consecutive register
cx1d p1, r0, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be an even-numbered register in the range [r0, r10]
cx1d p1, r1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be a consecutive register
cx1d p1, r2, r4, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be an even-numbered register in the range [r0, r10]
cx1da p0, r1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
cx1 p0, r0, r0, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
cx1d p0, r0, r1, r2, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
cx1a p0, r0, r2,
// CHECK-LABEL: test_cx2:
test_cx2:
// CHECK-NEXT: cx2 p0, r3, r7, cx2 p0, r3, r7, // CHECK-NEXT: cx2a p0, r1, r4, cx2a p0, r1, r4, // CHECK-NEXT: cx2d p0, r2, r3, r1, cx2d p0, r2, r3, r1, // CHECK-NEXT: cx2da p0, r2, r3, r7, cx2da p0, r2, r3, r7, // CHECK-NEXT: cx2da p1, r10, r11, apsr_nzcv, cx2da p1, r10, r11, apsr_nzcv,
// ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be an immediate in the range [0,511]
cx2 p0, r1, r4, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be an even-numbered register in the range [r0, r10]
cx2d p0, r12, r7, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be an even-numbered register in the range [r0, r10]
cx2da p0, r7, r7, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be an even-numbered register in the range [r0, r10]
cx2da p1, apsr_nzcv, r7, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
cx2 p0, r0, r0, r7, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be a consecutive register
cx2d p0, r0, r0, r7, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
cx2a p0, r0, r2, r7, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be a consecutive register
cx2da p0, r0, r2, r7,
// CHECK-LABEL: test_cx3:
test_cx3:
// CHECK-NEXT: cx3 p0, r1, r2, r3, cx3 p0, r1, r2, r3, // CHECK-NEXT: cx3a p0, r1, r5, r7, cx3a p0, r1, r5, r7, // CHECK-NEXT: cx3d p1, r0, r1, r7, r1, cx3d p1, r0, r1, r7, r1, // CHECK-NEXT: cx3da p0, r8, r9, r2, r3, cx3da p0, r8, r9, r2, r3, // CHECK-NEXT: cx3 p1, apsr_nzcv, r7, apsr_nzcv, cx3 p1, apsr_nzcv, r7, apsr_nzcv, // CHECK-NEXT: cx3d p0, r8, r9, apsr_nzcv, apsr_nzcv, cx3d p0, r8, r9, apsr_nzcv, apsr_nzcv,
// ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be an immediate in the range [0,63]
cx3 p0, r1, r5, r7, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be an even-numbered register in the range [r0, r10]
cx3da p1, r14, r2, r3, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be a register in the range [r0, r12], r14 or apsr_nzcv
cx3a p0, r15, r2, r3, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
cx2 p0, r0, r0, r7, r3, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be a consecutive register
cx2d p0, r0, r0, r7, r3, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
cx3a p0, r1, r2, r5, r7, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: operand must be a consecutive register
cx3da p0, r8, apsr_nzcv, r2, r3,
// ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx1 p0, s0, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx1 p0, d0, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx1 p0, q0, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx1a p0, s0, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx1a p0, d0, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx1a p0, q0, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx2 p0, s0, s1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx2 p0, d0, d1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx2 p0, q0, q1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx2a p0, s0, s1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx2a p0, d0, d1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx2 p0, q0, q1, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx3 p0, s0, s1, s2, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx3 p0, d0, d1, d2, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx3 p0, q0, q1, q2, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx3a p0, s0, s1, s2, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx3a p0, d0, d1, d2, // ERROR: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
vcx3a p0, q0, q1, q2,