1 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
3 declare i8* @llvm.returnaddress(i32)
4 define void @return_address(i32 %var) {
5 ; CHECK: immarg operand has non-immediate parameter
7 ; CHECK-NEXT: %result = call i8* @llvm.returnaddress(i32 %var)
8 %result = call i8* @llvm.returnaddress(i32 %var)
12 declare i8* @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 i8* @llvm.frameaddress.p0i8(i32 %var)
17 %result = call i8* @llvm.frameaddress(i32 %var)
21 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1)
22 define void @memcpy(i8* %dest, i8* %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.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
26 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
30 declare void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1)
31 define void @memcpy_inline_is_volatile(i8* %dest, i8* %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.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
35 call void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
39 define void @memcpy_inline_variable_size(i8* %dest, i8* %src, i32 %size) {
40 ; CHECK: immarg operand has non-immediate parameter
41 ; CHECK-NEXT: i32 %size
42 ; CHECK-NEXT: call void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %size, i1 true)
43 call void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %size, i1 true)
47 declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1)
48 define void @memmove(i8* %dest, i8* %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.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
52 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
56 declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1)
57 define void @memset(i8* %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.p0i8.i32(i8* %dest, i8 %val, i32 8, i1 %is.volatile)
61 call void @llvm.memset.p0i8.i32(i8* %dest, i8 %val, i32 8, i1 %is.volatile)
66 declare i64 @llvm.objectsize.i64.p0i8(i8*, i1, i1, i1)
67 define void @objectsize(i8* %ptr, i1 %a, i1 %b, i1 %c) {
68 ; CHECK: immarg operand has non-immediate parameter
70 ; CHECK-NEXT: %val0 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 %a, i1 false, i1 false)
71 %val0 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 %a, i1 false, i1 false)
73 ; CHECK: immarg operand has non-immediate parameter
75 ; CHECK-NEXT: %val1 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 %b, i1 false)
76 %val1 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 %b, i1 false)
78 ; CHECK: immarg operand has non-immediate parameter
80 ; CHECK-NEXT: %val2 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 false, i1 %c)
81 %val2 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 false, i1 %c)
85 declare i64 @llvm.smul.fix.i64(i64, i64, i32)
86 define i64 @smul_fix(i64 %arg0, i64 %arg1, i32 %arg2) {
87 ; CHECK: immarg operand has non-immediate parameter
88 ; CHECK-NEXT: i32 %arg2
89 ; CHECK-NEXT: %ret = call i64 @llvm.smul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
90 %ret = call i64 @llvm.smul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
94 declare i64 @llvm.smul.fix.sat.i64(i64, i64, i32)
95 define i64 @smul_fix_sat(i64 %arg0, i64 %arg1, i32 %arg2) {
96 ; CHECK: immarg operand has non-immediate parameter
97 ; CHECK-NEXT: i32 %arg2
98 ; CHECK-NEXT: %ret = call i64 @llvm.smul.fix.sat.i64(i64 %arg0, i64 %arg1, i32 %arg2)
99 %ret = call i64 @llvm.smul.fix.sat.i64(i64 %arg0, i64 %arg1, i32 %arg2)
103 declare i64 @llvm.umul.fix.i64(i64, i64, i32)
104 define i64 @umul_fix(i64 %arg0, i64 %arg1, i32 %arg2) {
105 ; CHECK: immarg operand has non-immediate parameter
106 ; CHECK-NEXT: i32 %arg2
107 ; CHECK-NEXT: %ret = call i64 @llvm.umul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
108 %ret = call i64 @llvm.umul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
112 declare i64 @llvm.umul.fix.sat.i64(i64, i64, i32)
113 define i64 @umul_fix_sat(i64 %arg0, i64 %arg1, i32 %arg2) {
114 ; CHECK: immarg operand has non-immediate parameter
115 ; CHECK-NEXT: i32 %arg2
116 ; CHECK-NEXT: %ret = call i64 @llvm.umul.fix.sat.i64(i64 %arg0, i64 %arg1, i32 %arg2)
117 %ret = call i64 @llvm.umul.fix.sat.i64(i64 %arg0, i64 %arg1, i32 %arg2)
121 declare <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>*, i32, <2 x i1>, <2 x double>)
122 define <2 x double> @masked_load(<2 x i1> %mask, <2 x double>* %addr, <2 x double> %dst, i32 %align) {
123 ; CHECK: immarg operand has non-immediate parameter
124 ; CHECK-NEXT: i32 %align
125 ; CHECK-NEXT: %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %addr, i32 %align, <2 x i1> %mask, <2 x double> %dst)
126 %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %addr, i32 %align, <2 x i1> %mask, <2 x double> %dst)
127 ret <2 x double> %res
130 declare void @llvm.masked.store.v4i32.p0v4i32(<4 x i32>, <4 x i32>*, i32, <4 x i1>)
131 define void @masked_store(<4 x i1> %mask, <4 x i32>* %addr, <4 x i32> %val, i32 %align) {
132 ; CHECK: immarg operand has non-immediate parameter
133 ; CHECK-NEXT: i32 %align
134 ; CHECK-NEXT: call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %val, <4 x i32>* %addr, i32 %align, <4 x i1> %mask)
135 call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %val, <4 x i32>* %addr, i32 %align, <4 x i1> %mask)
139 declare <2 x double> @llvm.masked.gather.v2f64.v2p0f64(<2 x double*>, i32, <2 x i1>, <2 x double>)
140 define <2 x double> @test_gather(<2 x double*> %ptrs, <2 x i1> %mask, <2 x double> %src0, i32 %align) {
141 ; CHECK: immarg operand has non-immediate parameter
143 ; CHECK: %res = call <2 x double> @llvm.masked.gather.v2f64.v2p0f64(<2 x double*> %ptrs, i32 %align, <2 x i1> %mask, <2 x double> %src0)
144 %res = call <2 x double> @llvm.masked.gather.v2f64.v2p0f64(<2 x double*> %ptrs, i32 %align, <2 x i1> %mask, <2 x double> %src0)
145 ret <2 x double> %res
148 declare void @llvm.masked.scatter.v8i32.v8p0i32(<8 x i32>, <8 x i32*>, i32, <8 x i1>)
149 define void @test_scatter_8i32(<8 x i32> %a1, <8 x i32*> %ptr, <8 x i1> %mask, i32 %align) {
150 ; CHECK: immarg operand has non-immediate parameter
151 ; CHECK-NEXT: i32 %align
152 ; CHECK-NEXT: call void @llvm.masked.scatter.v8i32.v8p0i32(<8 x i32> %a1, <8 x i32*> %ptr, i32 %align, <8 x i1> %mask)
153 call void @llvm.masked.scatter.v8i32.v8p0i32(<8 x i32> %a1, <8 x i32*> %ptr, i32 %align, <8 x i1> %mask)
157 declare void @llvm.lifetime.start.p0i8(i64, i8*)
158 define void @test_lifetime_start(i64 %arg0, i8* %ptr) {
159 ; CHECK: immarg operand has non-immediate parameter
160 ; CHECK-NEXT: i64 %arg0
161 ; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 %arg0, i8* %ptr)
162 call void @llvm.lifetime.start.p0i8(i64 %arg0, i8* %ptr)
166 declare void @llvm.lifetime.end.p0i8(i64, i8*)
167 define void @test_lifetime_end(i64 %arg0, i8* %ptr) {
168 ; CHECK: immarg operand has non-immediate parameter
169 ; CHECK-NEXT: i64 %arg0
170 ; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 %arg0, i8* %ptr)
171 call void @llvm.lifetime.end.p0i8(i64 %arg0, i8* %ptr)
175 declare void @llvm.invariant.start.p0i8(i64, i8*)
176 define void @test_invariant_start(i64 %arg0, i8* %ptr) {
177 ; CHECK: immarg operand has non-immediate parameter
178 ; CHECK-NEXT: i64 %arg0
179 ; CHECK-NEXT: call void @llvm.invariant.start.p0i8(i64 %arg0, i8* %ptr)
180 call void @llvm.invariant.start.p0i8(i64 %arg0, i8* %ptr)
184 declare void @llvm.invariant.end.p0i8({}*, i64, i8*)
185 define void @test_invariant_end({}* %scope, i64 %arg1, i8* %ptr) {
186 ; CHECK: immarg operand has non-immediate parameter
187 ; CHECK-NEXT: i64 %arg1
188 ; CHECK-NEXT: call void @llvm.invariant.end.p0i8({}* %scope, i64 %arg1, i8* %ptr)
189 call void @llvm.invariant.end.p0i8({}* %scope, i64 %arg1, i8* %ptr)
193 declare void @llvm.prefetch(i8*, i32, i32, i32)
194 define void @test_prefetch(i8* %ptr, i32 %arg0, i32 %arg1) {
195 ; CHECK: immarg operand has non-immediate parameter
196 ; CHECK-NEXT: i32 %arg0
197 ; CHECK-NEXT: call void @llvm.prefetch.p0i8(i8* %ptr, i32 %arg0, i32 0, i32 0)
198 ; CHECK: immarg operand has non-immediate parameter
199 ; CHECK-NEXT: i32 %arg1
200 call void @llvm.prefetch(i8* %ptr, i32 %arg0, i32 0, i32 0)
201 call void @llvm.prefetch(i8* %ptr, i32 0, i32 %arg1, i32 0)
205 declare void @llvm.localrecover(i8*, i8*, i32)
206 define void @test_localrecover(i8* %func, i8* %fp, i32 %idx) {
207 ; CHECK: immarg operand has non-immediate parameter
208 ; CHECK-NEXT: i32 %idx
209 ; CHECK-NEXT: call void @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
210 call void @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
214 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
216 define private void @f() {
220 define void @calls_statepoint(i8 addrspace(1)* %arg0, i64 %arg1, i32 %arg2, i32 %arg4, i32 %arg5) gc "statepoint-example" {
221 ; CHECK: immarg operand has non-immediate parameter
222 ; CHECK-NEXT: i64 %arg1
223 ; CHECK-NEXT: %safepoint0 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 %arg1, i32 0, void ()* @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
224 ; CHECK: immarg operand has non-immediate parameter
225 ; CHECK-NEXT: i32 %arg2
226 ; CHECK-NEXT: %safepoint1 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 %arg2, void ()* @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
227 ; CHECK: immarg operand has non-immediate parameter
228 ; CHECK-NEXT: i32 %arg4
229 ; CHECK-NEXT: %safepoint2 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @f, i32 %arg4, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
230 ; CHECK: immarg operand has non-immediate parameter
231 ; CHECK-NEXT: i32 %arg5
232 ; CHECK-NEXT: %safepoint3 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @f, i32 0, i32 %arg5, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
233 %cast = bitcast i8 addrspace(1)* %arg0 to i64 addrspace(1)*
234 %safepoint0 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 %arg1, i32 0, void ()* @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
235 %safepoint1 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 %arg2, void ()* @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
236 %safepoint2 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @f, i32 %arg4, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
237 %safepoint3 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @f, i32 0, i32 %arg5, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
241 declare void @llvm.hwasan.check.memaccess(i8*, i8*, i32)
243 define void @hwasan_check_memaccess(i8* %arg0,i8* %arg1, i32 %arg2) {
244 ; CHECK: immarg operand has non-immediate parameter
246 ; CHECK: call void @llvm.hwasan.check.memaccess(i8* %arg0, i8* %arg1, i32 %arg2)
247 call void @llvm.hwasan.check.memaccess(i8* %arg0,i8* %arg1, i32 %arg2)