[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / AArch64 / SVE / sqsub-diagnostics.s
blob15633050ebfddcbe23f9bd01563d2a226f6e8a54
1 // RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
3 // Register z32 does not exist.
4 sqsub z22.h, z10.h, z32.h
5 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
6 // CHECK-NEXT: sqsub z22.h, z10.h, z32.h
7 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
9 // Invalid element kind.
10 sqsub z20.h, z2.h, z31.x
11 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid vector kind qualifier
12 // CHECK-NEXT: sqsub z20.h, z2.h, z31.x
13 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15 // Element size specifiers should match.
16 sqsub z27.h, z11.h, z27.b
17 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
18 // CHECK-NEXT: sqsub z27.h, z11.h, z27.b
19 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
22 // --------------------------------------------------------------------------//
23 // Invalid immediates
25 sqsub z0.b, z0.b, #0, lsl #8 // #0, lsl #8 is not valid for .b
26 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] with a shift amount of 0
27 // CHECK-NEXT: sqsub z0.b, z0.b, #0, lsl #8
28 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
30 sqsub z0.b, z0.b, #-1
31 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] with a shift amount of 0
32 // CHECK-NEXT: sqsub z0.b, z0.b, #-1
33 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
35 sqsub z0.b, z0.b, #1, lsl #8
36 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] with a shift amount of 0
37 // CHECK-NEXT: sqsub z0.b, z0.b, #1, lsl #8
38 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
40 sqsub z0.b, z0.b, #256
41 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] with a shift amount of 0
42 // CHECK-NEXT: sqsub z0.b, z0.b, #256
43 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
45 sqsub z0.h, z0.h, #-1
46 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280]
47 // CHECK-NEXT: sqsub z0.h, z0.h, #-1
48 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
50 sqsub z0.h, z0.h, #256, lsl #8
51 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280]
52 // CHECK-NEXT: sqsub z0.h, z0.h, #256, lsl #8
53 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
55 sqsub z0.h, z0.h, #65536
56 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280]
57 // CHECK-NEXT: sqsub z0.h, z0.h, #65536
58 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
60 sqsub z0.s, z0.s, #-1
61 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280]
62 // CHECK-NEXT: sqsub z0.s, z0.s, #-1
63 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
65 sqsub z0.s, z0.s, #256, lsl #8
66 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280]
67 // CHECK-NEXT: sqsub z0.s, z0.s, #256, lsl #8
68 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
70 sqsub z0.s, z0.s, #65536
71 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280]
72 // CHECK-NEXT: sqsub z0.s, z0.s, #65536
73 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
75 sqsub z0.d, z0.d, #-1
76 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280]
77 // CHECK-NEXT: sqsub z0.d, z0.d, #-1
78 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
80 sqsub z0.d, z0.d, #256, lsl #8
81 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280]
82 // CHECK-NEXT: sqsub z0.d, z0.d, #256, lsl #8
83 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
85 sqsub z0.d, z0.d, #65536
86 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280]
87 // CHECK-NEXT: sqsub z0.d, z0.d, #65536
88 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
91 // --------------------------------------------------------------------------//
92 // Negative tests for instructions that are incompatible with movprfx
94 movprfx z31.d, p0/z, z6.d
95 sqsub z31.d, z31.d, #65280
96 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx, suggest using unpredicated movprfx
97 // CHECK-NEXT: sqsub z31.d, z31.d, #65280
98 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
100 movprfx z0.d, p0/z, z7.d
101 sqsub z0.d, z0.d, z0.d
102 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
103 // CHECK-NEXT: sqsub z0.d, z0.d, z0.d
104 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
106 movprfx z0, z7
107 sqsub z0.d, z0.d, z0.d
108 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
109 // CHECK-NEXT: sqsub z0.d, z0.d, z0.d
110 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: