1 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
3 declare ptr @llvm.returnaddress(i32)
4 define void @return_address(i32 %var) {
5 ; CHECK: immarg operand has non-immediate parameter
7 ; CHECK-NEXT: %result = call ptr @llvm.returnaddress(i32 %var)
8 %result = call ptr @llvm.returnaddress(i32 %var)
12 declare ptr @llvm.frameaddress(i32)
13 define void @frame_address(i32 %var) {
14 ; CHECK: immarg operand has non-immediate parameter
15 ; CHECK-NEXT: i32 %var
16 ; CHECK-NEXT: %result = call ptr @llvm.frameaddress.p0(i32 %var)
17 %result = call ptr @llvm.frameaddress(i32 %var)
21 declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1)
22 define void @memcpy(ptr %dest, ptr %src, i1 %is.volatile) {
23 ; CHECK: immarg operand has non-immediate parameter
24 ; CHECK-NEXT: i1 %is.volatile
25 ; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
26 call void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
30 declare void @llvm.memcpy.inline.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1)
31 define void @memcpy_inline_is_volatile(ptr %dest, ptr %src, i1 %is.volatile) {
32 ; CHECK: immarg operand has non-immediate parameter
33 ; CHECK-NEXT: i1 %is.volatile
34 ; CHECK-NEXT: call void @llvm.memcpy.inline.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
35 call void @llvm.memcpy.inline.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
39 define void @memcpy_inline_variable_size(ptr %dest, ptr %src, i32 %size) {
40 ; CHECK: immarg operand has non-immediate parameter
41 ; CHECK-NEXT: i32 %size
42 ; CHECK-NEXT: call void @llvm.memcpy.inline.p0.p0.i32(ptr %dest, ptr %src, i32 %size, i1 true)
43 call void @llvm.memcpy.inline.p0.p0.i32(ptr %dest, ptr %src, i32 %size, i1 true)
47 declare void @llvm.memmove.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1)
48 define void @memmove(ptr %dest, ptr %src, i1 %is.volatile) {
49 ; CHECK: immarg operand has non-immediate parameter
50 ; CHECK-NEXT: i1 %is.volatile
51 ; CHECK-NEXT: call void @llvm.memmove.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
52 call void @llvm.memmove.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
56 declare void @llvm.memset.p0.i32(ptr nocapture, i8, i32, i1)
57 define void @memset(ptr %dest, i8 %val, i1 %is.volatile) {
58 ; CHECK: immarg operand has non-immediate parameter
59 ; CHECK-NEXT: i1 %is.volatile
60 ; CHECK-NEXT: call void @llvm.memset.p0.i32(ptr %dest, i8 %val, i32 8, i1 %is.volatile)
61 call void @llvm.memset.p0.i32(ptr %dest, i8 %val, i32 8, i1 %is.volatile)
65 declare void @llvm.memset.inline.p0.i32(ptr nocapture, i8, i32, i1)
66 define void @memset_inline_is_volatile(ptr %dest, i8 %value, i1 %is.volatile) {
67 ; CHECK: immarg operand has non-immediate parameter
68 ; CHECK-NEXT: i1 %is.volatile
69 ; CHECK-NEXT: call void @llvm.memset.inline.p0.i32(ptr %dest, i8 %value, i32 8, i1 %is.volatile)
70 call void @llvm.memset.inline.p0.i32(ptr %dest, i8 %value, i32 8, i1 %is.volatile)
74 define void @memset_inline_variable_size(ptr %dest, i8 %value, i32 %size) {
75 ; CHECK: immarg operand has non-immediate parameter
76 ; CHECK-NEXT: i32 %size
77 ; CHECK-NEXT: call void @llvm.memset.inline.p0.i32(ptr %dest, i8 %value, i32 %size, i1 true)
78 call void @llvm.memset.inline.p0.i32(ptr %dest, i8 %value, i32 %size, i1 true)
83 declare i64 @llvm.objectsize.i64.p0(ptr, i1, i1, i1)
84 define void @objectsize(ptr %ptr, i1 %a, i1 %b, i1 %c) {
85 ; CHECK: immarg operand has non-immediate parameter
87 ; CHECK-NEXT: %val0 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 %a, i1 false, i1 false)
88 %val0 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 %a, i1 false, i1 false)
90 ; CHECK: immarg operand has non-immediate parameter
92 ; CHECK-NEXT: %val1 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 false, i1 %b, i1 false)
93 %val1 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 false, i1 %b, i1 false)
95 ; CHECK: immarg operand has non-immediate parameter
97 ; CHECK-NEXT: %val2 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 false, i1 false, i1 %c)
98 %val2 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 false, i1 false, i1 %c)
102 declare i64 @llvm.smul.fix.i64(i64, i64, i32)
103 define i64 @smul_fix(i64 %arg0, i64 %arg1, i32 %arg2) {
104 ; CHECK: immarg operand has non-immediate parameter
105 ; CHECK-NEXT: i32 %arg2
106 ; CHECK-NEXT: %ret = call i64 @llvm.smul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
107 %ret = call i64 @llvm.smul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
111 declare i64 @llvm.smul.fix.sat.i64(i64, i64, i32)
112 define i64 @smul_fix_sat(i64 %arg0, i64 %arg1, i32 %arg2) {
113 ; CHECK: immarg operand has non-immediate parameter
114 ; CHECK-NEXT: i32 %arg2
115 ; CHECK-NEXT: %ret = call i64 @llvm.smul.fix.sat.i64(i64 %arg0, i64 %arg1, i32 %arg2)
116 %ret = call i64 @llvm.smul.fix.sat.i64(i64 %arg0, i64 %arg1, i32 %arg2)
120 declare i64 @llvm.umul.fix.i64(i64, i64, i32)
121 define i64 @umul_fix(i64 %arg0, i64 %arg1, i32 %arg2) {
122 ; CHECK: immarg operand has non-immediate parameter
123 ; CHECK-NEXT: i32 %arg2
124 ; CHECK-NEXT: %ret = call i64 @llvm.umul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
125 %ret = call i64 @llvm.umul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
129 declare i64 @llvm.umul.fix.sat.i64(i64, i64, i32)
130 define i64 @umul_fix_sat(i64 %arg0, i64 %arg1, i32 %arg2) {
131 ; CHECK: immarg operand has non-immediate parameter
132 ; CHECK-NEXT: i32 %arg2
133 ; CHECK-NEXT: %ret = call i64 @llvm.umul.fix.sat.i64(i64 %arg0, i64 %arg1, i32 %arg2)
134 %ret = call i64 @llvm.umul.fix.sat.i64(i64 %arg0, i64 %arg1, i32 %arg2)
138 declare <2 x double> @llvm.masked.load.v2f64.p0(ptr, i32, <2 x i1>, <2 x double>)
139 define <2 x double> @masked_load(<2 x i1> %mask, ptr %addr, <2 x double> %dst, i32 %align) {
140 ; CHECK: immarg operand has non-immediate parameter
141 ; CHECK-NEXT: i32 %align
142 ; CHECK-NEXT: %res = call <2 x double> @llvm.masked.load.v2f64.p0(ptr %addr, i32 %align, <2 x i1> %mask, <2 x double> %dst)
143 %res = call <2 x double> @llvm.masked.load.v2f64.p0(ptr %addr, i32 %align, <2 x i1> %mask, <2 x double> %dst)
144 ret <2 x double> %res
147 declare void @llvm.masked.store.v4i32.p0(<4 x i32>, ptr, i32, <4 x i1>)
148 define void @masked_store(<4 x i1> %mask, ptr %addr, <4 x i32> %val, i32 %align) {
149 ; CHECK: immarg operand has non-immediate parameter
150 ; CHECK-NEXT: i32 %align
151 ; CHECK-NEXT: call void @llvm.masked.store.v4i32.p0(<4 x i32> %val, ptr %addr, i32 %align, <4 x i1> %mask)
152 call void @llvm.masked.store.v4i32.p0(<4 x i32> %val, ptr %addr, i32 %align, <4 x i1> %mask)
156 declare <2 x double> @llvm.masked.gather.v2f64.v2p0(<2 x ptr>, i32, <2 x i1>, <2 x double>)
157 define <2 x double> @test_gather(<2 x ptr> %ptrs, <2 x i1> %mask, <2 x double> %src0, i32 %align) {
158 ; CHECK: immarg operand has non-immediate parameter
160 ; CHECK: %res = call <2 x double> @llvm.masked.gather.v2f64.v2p0(<2 x ptr> %ptrs, i32 %align, <2 x i1> %mask, <2 x double> %src0)
161 %res = call <2 x double> @llvm.masked.gather.v2f64.v2p0(<2 x ptr> %ptrs, i32 %align, <2 x i1> %mask, <2 x double> %src0)
162 ret <2 x double> %res
165 declare void @llvm.masked.scatter.v8i32.v8p0(<8 x i32>, <8 x ptr>, i32, <8 x i1>)
166 define void @test_scatter_8i32(<8 x i32> %a1, <8 x ptr> %ptr, <8 x i1> %mask, i32 %align) {
167 ; CHECK: immarg operand has non-immediate parameter
168 ; CHECK-NEXT: i32 %align
169 ; CHECK-NEXT: call void @llvm.masked.scatter.v8i32.v8p0(<8 x i32> %a1, <8 x ptr> %ptr, i32 %align, <8 x i1> %mask)
170 call void @llvm.masked.scatter.v8i32.v8p0(<8 x i32> %a1, <8 x ptr> %ptr, i32 %align, <8 x i1> %mask)
174 declare void @llvm.lifetime.start.p0(i64, ptr)
175 define void @test_lifetime_start(i64 %arg0, ptr %ptr) {
176 ; CHECK: immarg operand has non-immediate parameter
177 ; CHECK-NEXT: i64 %arg0
178 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 %arg0, ptr %ptr)
179 call void @llvm.lifetime.start.p0(i64 %arg0, ptr %ptr)
183 declare void @llvm.lifetime.end.p0(i64, ptr)
184 define void @test_lifetime_end(i64 %arg0, ptr %ptr) {
185 ; CHECK: immarg operand has non-immediate parameter
186 ; CHECK-NEXT: i64 %arg0
187 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 %arg0, ptr %ptr)
188 call void @llvm.lifetime.end.p0(i64 %arg0, ptr %ptr)
192 declare void @llvm.invariant.start.p0(i64, ptr)
193 define void @test_invariant_start(i64 %arg0, ptr %ptr) {
194 ; CHECK: immarg operand has non-immediate parameter
195 ; CHECK-NEXT: i64 %arg0
196 ; CHECK-NEXT: call void @llvm.invariant.start.p0(i64 %arg0, ptr %ptr)
197 call void @llvm.invariant.start.p0(i64 %arg0, ptr %ptr)
201 declare void @llvm.invariant.end.p0(ptr, i64, ptr)
202 define void @test_invariant_end(ptr %scope, i64 %arg1, ptr %ptr) {
203 ; CHECK: immarg operand has non-immediate parameter
204 ; CHECK-NEXT: i64 %arg1
205 ; CHECK-NEXT: call void @llvm.invariant.end.p0(ptr %scope, i64 %arg1, ptr %ptr)
206 call void @llvm.invariant.end.p0(ptr %scope, i64 %arg1, ptr %ptr)
210 declare void @llvm.prefetch(ptr, i32, i32, i32)
211 define void @test_prefetch(ptr %ptr, i32 %arg0, i32 %arg1) {
212 ; CHECK: immarg operand has non-immediate parameter
213 ; CHECK-NEXT: i32 %arg0
214 ; CHECK-NEXT: call void @llvm.prefetch.p0(ptr %ptr, i32 %arg0, i32 0, i32 0)
215 ; CHECK: immarg operand has non-immediate parameter
216 ; CHECK-NEXT: i32 %arg1
217 call void @llvm.prefetch(ptr %ptr, i32 %arg0, i32 0, i32 0)
218 call void @llvm.prefetch(ptr %ptr, i32 0, i32 %arg1, i32 0)
222 declare void @llvm.localrecover(ptr, ptr, i32)
223 define void @test_localrecover(ptr %func, ptr %fp, i32 %idx) {
224 ; CHECK: immarg operand has non-immediate parameter
225 ; CHECK-NEXT: i32 %idx
226 ; CHECK-NEXT: call void @llvm.localrecover(ptr %func, ptr %fp, i32 %idx)
227 call void @llvm.localrecover(ptr %func, ptr %fp, i32 %idx)
231 declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
233 define private void @f() {
237 define void @calls_statepoint(ptr addrspace(1) %arg0, i64 %arg1, i32 %arg2, i32 %arg4, i32 %arg5) gc "statepoint-example" {
238 ; CHECK: immarg operand has non-immediate parameter
239 ; CHECK-NEXT: i64 %arg1
240 ; CHECK-NEXT: %safepoint0 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 %arg1, i32 0, ptr @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
241 ; CHECK: immarg operand has non-immediate parameter
242 ; CHECK-NEXT: i32 %arg2
243 ; CHECK-NEXT: %safepoint1 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 %arg2, ptr @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
244 ; CHECK: immarg operand has non-immediate parameter
245 ; CHECK-NEXT: i32 %arg4
246 ; CHECK-NEXT: %safepoint2 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @f, i32 %arg4, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
247 ; CHECK: immarg operand has non-immediate parameter
248 ; CHECK-NEXT: i32 %arg5
249 ; CHECK-NEXT: %safepoint3 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @f, i32 0, i32 %arg5, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
250 %safepoint0 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 %arg1, i32 0, ptr @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
251 %safepoint1 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 %arg2, ptr @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
252 %safepoint2 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @f, i32 %arg4, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
253 %safepoint3 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @f, i32 0, i32 %arg5, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
257 declare void @llvm.hwasan.check.memaccess(ptr, ptr, i32)
259 define void @hwasan_check_memaccess(ptr %arg0,ptr %arg1, i32 %arg2) {
260 ; CHECK: immarg operand has non-immediate parameter
262 ; CHECK: call void @llvm.hwasan.check.memaccess(ptr %arg0, ptr %arg1, i32 %arg2)
263 call void @llvm.hwasan.check.memaccess(ptr %arg0,ptr %arg1, i32 %arg2)
267 declare void @llvm.eh.sjlj.callsite(i32)
269 define void @eh_sjlj_callsite(i32 %arg0) {
270 ; CHECK: immarg operand has non-immediate parameter
272 ; CHECK: call void @llvm.eh.sjlj.callsite(i32 %arg0)
273 call void @llvm.eh.sjlj.callsite(i32 %arg0)