1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve  2>&1 < %s| FileCheck %s
2
3// --------------------------------------------------------------------------//
4// Invalid addressing modes.
5
6adr z0.s, [z0.s, z0.d]
7// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
8// CHECK-NEXT: adr z0.s, [z0.s, z0.d]
9// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10
11adr z0.s, [z0.s, z0.s, lsl]
12// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: expected #imm after shift specifier
13// CHECK-NEXT: adr z0.s, [z0.s, z0.s, lsl]
14// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15
16adr z0.s, [z0.s, z0.s, lsl #4]
17// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s'
18// CHECK-NEXT: adr z0.s, [z0.s, z0.s, lsl #4]
19// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
20
21adr z0.s, [z0.s, z0.s, uxtw]
22// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s'
23// CHECK-NEXT: adr z0.s, [z0.s, z0.s, uxtw]
24// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
25
26adr z0.s, [z0.s, z0.s, sxtw]
27// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s'
28// CHECK-NEXT: adr z0.s, [z0.s, z0.s, sxtw]
29// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
30
31adr z0.d, [z0.d, z0.s]
32// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
33// CHECK-NEXT: adr z0.d, [z0.d, z0.s]
34// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
35
36adr z0.d, [z0.d, z0.s, uxtw]
37// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
38// CHECK-NEXT: adr z0.d, [z0.d, z0.s, uxtw]
39// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
40
41adr z0.d, [z0.d, z0.s, sxtw]
42// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
43// CHECK-NEXT: adr z0.d, [z0.d, z0.s, sxtw]
44// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
45
46adr z0.d, [z0.d, z0.d, lsl #4]
47// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #3'
48// CHECK-NEXT: adr z0.d, [z0.d, z0.d, lsl #4]
49// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
50
51adr z0.d, [z0.d, z0.d, uxtw #4]
52// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #3'
53// CHECK-NEXT: adr z0.d, [z0.d, z0.d, uxtw #4]
54// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
55
56adr z0.d, [z0.d, z0.d, sxtw #4]
57// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #3'
58// CHECK-NEXT: adr z0.d, [z0.d, z0.d, sxtw #4]
59// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
60
61
62// --------------------------------------------------------------------------//
63// Negative tests for instructions that are incompatible with movprfx
64
65movprfx z0.d, p0/z, z7.d
66adr     z0.d, [z0.d, z0.d, sxtw #3]
67// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
68// CHECK-NEXT: adr     z0.d, [z0.d, z0.d, sxtw #3]
69// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
70
71movprfx z0, z7
72adr     z0.d, [z0.d, z0.d, sxtw #3]
73// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
74// CHECK-NEXT: adr     z0.d, [z0.d, z0.d, sxtw #3]
75// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
76