1 // RUN
: llvm-mc
-triple
=aarch64-none-linux-gnu
< %s | FileCheck
%s
2 // RUN
: not llvm-mc
-mattr
=+no-neg-immediates
-triple
=aarch64-none-linux-gnu
< %s
2>&1 | FileCheck
%s
--check-prefix
=CHECK-NO-NEG-IMM
6 // CHECK
: add w0
, w2
, #1, lsl #12
7 // CHECK
: sub w0
, w2
, #1, lsl #12
11 // CHECK
: sub w0
, w2
, #1, lsl #12
12 // CHECK
: add w0
, w2
, #1, lsl #12
14 // CHECK
: sub w0
, w2
, #2, lsl #12
15 // CHECK
: sub w0
, w2
, #2, lsl #12
16 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
17 sub w0
, w2
, #2, lsl 12
18 add w0
, w2
, #-2, lsl 12
19 // CHECK
: sub x1
, x3
, #2, lsl #12
20 // CHECK
: sub x1
, x3
, #2, lsl #12
21 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
22 sub x1
, x3
, #2, lsl 12
23 add x1
, x3
, #-2, lsl 12
24 // CHECK
: sub x1
, x3
, #4
25 // CHECK
: sub x1
, x3
, #4
26 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
29 // CHECK
: sub x1
, x3
, #4095
30 // CHECK
: sub x1
, x3
, #4095
31 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
32 sub x1
, x3
, #4095, lsl 0
33 add x1
, x3
, #-4095, lsl 0
34 // CHECK
: sub x3
, x4
, #0
37 // CHECK
: add w0
, w2
, #2, lsl #12
38 // CHECK
: add w0
, w2
, #2, lsl #12
39 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
40 add w0
, w2
, #2, lsl 12
41 sub w0
, w2
, #-2, lsl 12
42 // CHECK
: add x1
, x3
, #2, lsl #12
43 // CHECK
: add x1
, x3
, #2, lsl #12
44 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
45 add x1
, x3
, #2, lsl 12
46 sub x1
, x3
, #-2, lsl 12
47 // CHECK
: add x1
, x3
, #4
48 // CHECK
: add x1
, x3
, #4
49 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
52 // CHECK
: add x1
, x3
, #4095
53 // CHECK
: add x1
, x3
, #4095
54 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
55 add x1
, x3
, #4095, lsl 0
56 sub x1
, x3
, #-4095, lsl 0
57 // CHECK
: add x2
, x5
, #0
60 // CHECK
: subs w0
, w2
, #2, lsl #12
61 // CHECK
: subs w0
, w2
, #2, lsl #12
62 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
63 subs w0
, w2
, #2, lsl 12
64 adds w0
, w2
, #-2, lsl 12
65 // CHECK
: subs x1
, x3
, #2, lsl #12
66 // CHECK
: subs x1
, x3
, #2, lsl #12
67 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
68 subs x1
, x3
, #2, lsl 12
69 adds x1
, x3
, #-2, lsl 12
70 // CHECK
: subs x1
, x3
, #4
71 // CHECK
: subs x1
, x3
, #4
72 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
75 // CHECK
: subs x1
, x3
, #4095
76 // CHECK
: subs x1
, x3
, #4095
77 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
78 subs x1
, x3
, #4095, lsl 0
79 adds x1
, x3
, #-4095, lsl 0
80 // CHECK
: subs x3
, x4
, #0
83 // CHECK
: adds w0
, w2
, #2, lsl #12
84 // CHECK
: adds w0
, w2
, #2, lsl #12
85 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
86 adds w0
, w2
, #2, lsl 12
87 subs w0
, w2
, #-2, lsl 12
88 // CHECK
: adds x1
, x3
, #2, lsl #12
89 // CHECK
: adds x1
, x3
, #2, lsl #12
90 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
91 adds x1
, x3
, #2, lsl 12
92 subs x1
, x3
, #-2, lsl 12
93 // CHECK
: adds x1
, x3
, #4
94 // CHECK
: adds x1
, x3
, #4
95 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
98 // CHECK
: adds x1
, x3
, #4095
99 // CHECK
: adds x1
, x3
, #4095
100 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
101 adds x1
, x3
, #4095, lsl 0
102 subs x1
, x3
, #-4095, lsl 0
103 // CHECK
: adds x2
, x5
, #0
106 // CHECK
: {{adds xzr
,|cmn
}} x5
, #5
107 // CHECK
: {{adds xzr
,|cmn
}} x5
, #5
108 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
111 // CHECK
: {{subs xzr
,|
cmp}} x6
, #4095
112 // CHECK
: {{subs xzr
,|
cmp}} x6
, #4095
113 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
116 // CHECK
: {{adds wzr
,|cmn
}} w7
, #5
117 // CHECK
: {{adds wzr
,|cmn
}} w7
, #5
118 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates
121 // CHECK
: {{subs wzr
,|
cmp}} w8
, #4095
122 // CHECK
: {{subs wzr
,|
cmp}} w8
, #4095
123 // CHECK-NO-NEG-IMM
: instruction requires
: NegativeImmediates