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.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1)
31 define void @memmove(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.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
35 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
39 declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1)
40 define void @memset(i8* %dest, i8 %val, i1 %is.volatile) {
41 ; CHECK: immarg operand has non-immediate parameter
42 ; CHECK-NEXT: i1 %is.volatile
43 ; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* %dest, i8 %val, i32 8, i1 %is.volatile)
44 call void @llvm.memset.p0i8.i32(i8* %dest, i8 %val, i32 8, i1 %is.volatile)
49 declare i64 @llvm.objectsize.i64.p0i8(i8*, i1, i1, i1)
50 define void @objectsize(i8* %ptr, i1 %a, i1 %b, i1 %c) {
51 ; CHECK: immarg operand has non-immediate parameter
53 ; CHECK-NEXT: %val0 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 %a, i1 false, i1 false)
54 %val0 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 %a, i1 false, i1 false)
56 ; CHECK: immarg operand has non-immediate parameter
58 ; CHECK-NEXT: %val1 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 %b, i1 false)
59 %val1 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 %b, i1 false)
61 ; CHECK: immarg operand has non-immediate parameter
63 ; CHECK-NEXT: %val2 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 false, i1 %c)
64 %val2 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 false, i1 %c)
68 declare i64 @llvm.smul.fix.i64(i64, i64, i32)
69 define i64 @smul_fix(i64 %arg0, i64 %arg1, i32 %arg2) {
70 ; CHECK: immarg operand has non-immediate parameter
71 ; CHECK-NEXT: i32 %arg2
72 ; CHECK-NEXT: %ret = call i64 @llvm.smul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
73 %ret = call i64 @llvm.smul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
77 declare i64 @llvm.umul.fix.i64(i64, i64, i32)
78 define i64 @umul_fix(i64 %arg0, i64 %arg1, i32 %arg2) {
79 ; CHECK: immarg operand has non-immediate parameter
80 ; CHECK-NEXT: i32 %arg2
81 ; CHECK-NEXT: %ret = call i64 @llvm.umul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
82 %ret = call i64 @llvm.umul.fix.i64(i64 %arg0, i64 %arg1, i32 %arg2)
86 declare <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>*, i32, <2 x i1>, <2 x double>)
87 define <2 x double> @masked_load(<2 x i1> %mask, <2 x double>* %addr, <2 x double> %dst, i32 %align) {
88 ; CHECK: immarg operand has non-immediate parameter
89 ; CHECK-NEXT: i32 %align
90 ; 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)
91 %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %addr, i32 %align, <2 x i1> %mask, <2 x double> %dst)
95 declare void @llvm.masked.store.v4i32.p0v4i32(<4 x i32>, <4 x i32>*, i32, <4 x i1>)
96 define void @masked_store(<4 x i1> %mask, <4 x i32>* %addr, <4 x i32> %val, i32 %align) {
97 ; CHECK: immarg operand has non-immediate parameter
98 ; CHECK-NEXT: i32 %align
99 ; CHECK-NEXT: call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %val, <4 x i32>* %addr, i32 %align, <4 x i1> %mask)
100 call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %val, <4 x i32>* %addr, i32 %align, <4 x i1> %mask)
104 declare <2 x double> @llvm.masked.gather.v2f64.v2p0f64(<2 x double*>, i32, <2 x i1>, <2 x double>)
105 define <2 x double> @test_gather(<2 x double*> %ptrs, <2 x i1> %mask, <2 x double> %src0, i32 %align) {
106 ; CHECK: immarg operand has non-immediate parameter
108 ; 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)
109 %res = call <2 x double> @llvm.masked.gather.v2f64.v2p0f64(<2 x double*> %ptrs, i32 %align, <2 x i1> %mask, <2 x double> %src0)
110 ret <2 x double> %res
113 declare void @llvm.masked.scatter.v8i32.v8p0i32(<8 x i32>, <8 x i32*>, i32, <8 x i1>)
114 define void @test_scatter_8i32(<8 x i32> %a1, <8 x i32*> %ptr, <8 x i1> %mask, i32 %align) {
115 ; CHECK: immarg operand has non-immediate parameter
116 ; CHECK-NEXT: i32 %align
117 ; CHECK-NEXT: call void @llvm.masked.scatter.v8i32.v8p0i32(<8 x i32> %a1, <8 x i32*> %ptr, i32 %align, <8 x i1> %mask)
118 call void @llvm.masked.scatter.v8i32.v8p0i32(<8 x i32> %a1, <8 x i32*> %ptr, i32 %align, <8 x i1> %mask)
122 declare void @llvm.lifetime.start.p0i8(i64, i8*)
123 define void @test_lifetime_start(i64 %arg0, i8* %ptr) {
124 ; CHECK: immarg operand has non-immediate parameter
125 ; CHECK-NEXT: i64 %arg0
126 ; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 %arg0, i8* %ptr)
127 call void @llvm.lifetime.start.p0i8(i64 %arg0, i8* %ptr)
131 declare void @llvm.lifetime.end.p0i8(i64, i8*)
132 define void @test_lifetime_end(i64 %arg0, i8* %ptr) {
133 ; CHECK: immarg operand has non-immediate parameter
134 ; CHECK-NEXT: i64 %arg0
135 ; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 %arg0, i8* %ptr)
136 call void @llvm.lifetime.end.p0i8(i64 %arg0, i8* %ptr)
140 declare void @llvm.invariant.start.p0i8(i64, i8*)
141 define void @test_invariant_start(i64 %arg0, i8* %ptr) {
142 ; CHECK: immarg operand has non-immediate parameter
143 ; CHECK-NEXT: i64 %arg0
144 ; CHECK-NEXT: call void @llvm.invariant.start.p0i8(i64 %arg0, i8* %ptr)
145 call void @llvm.invariant.start.p0i8(i64 %arg0, i8* %ptr)
149 declare void @llvm.invariant.end.p0i8({}*, i64, i8*)
150 define void @test_invariant_end({}* %scope, i64 %arg1, i8* %ptr) {
151 ; CHECK: immarg operand has non-immediate parameter
152 ; CHECK-NEXT: i64 %arg1
153 ; CHECK-NEXT: call void @llvm.invariant.end.p0i8({}* %scope, i64 %arg1, i8* %ptr)
154 call void @llvm.invariant.end.p0i8({}* %scope, i64 %arg1, i8* %ptr)
158 declare void @llvm.prefetch(i8*, i32, i32, i32)
159 define void @test_prefetch(i8* %ptr, i32 %arg0, i32 %arg1) {
160 ; CHECK: immarg operand has non-immediate parameter
161 ; CHECK-NEXT: i32 %arg0
162 ; CHECK-NEXT: call void @llvm.prefetch(i8* %ptr, i32 %arg0, i32 0, i32 0)
163 ; CHECK: immarg operand has non-immediate parameter
164 ; CHECK-NEXT: i32 %arg1
165 call void @llvm.prefetch(i8* %ptr, i32 %arg0, i32 0, i32 0)
166 call void @llvm.prefetch(i8* %ptr, i32 0, i32 %arg1, i32 0)
170 declare void @llvm.localrecover(i8*, i8*, i32)
171 define void @test_localrecover(i8* %func, i8* %fp, i32 %idx) {
172 ; CHECK: immarg operand has non-immediate parameter
173 ; CHECK-NEXT: i32 %idx
174 ; CHECK-NEXT: call void @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
175 call void @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
179 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
181 define private void @f() {
185 define void @calls_statepoint(i8 addrspace(1)* %arg0, i64 %arg1, i32 %arg2, i32 %arg4, i32 %arg5) gc "statepoint-example" {
186 ; CHECK: immarg operand has non-immediate parameter
187 ; CHECK-NEXT: i64 %arg1
188 ; 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)
189 ; CHECK: immarg operand has non-immediate parameter
190 ; CHECK-NEXT: i32 %arg2
191 ; 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)
192 ; CHECK: immarg operand has non-immediate parameter
193 ; CHECK-NEXT: i32 %arg4
194 ; 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)
195 ; CHECK: immarg operand has non-immediate parameter
196 ; CHECK-NEXT: i32 %arg5
197 ; 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)
198 %cast = bitcast i8 addrspace(1)* %arg0 to i64 addrspace(1)*
199 %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)
200 %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)
201 %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)
202 %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)
206 declare void @llvm.hwasan.check.memaccess(i8*, i8*, i32)
208 define void @hwasan_check_memaccess(i8* %arg0,i8* %arg1, i32 %arg2) {
209 ; CHECK: immarg operand has non-immediate parameter
211 ; CHECK: call void @llvm.hwasan.check.memaccess(i8* %arg0, i8* %arg1, i32 %arg2)
212 call void @llvm.hwasan.check.memaccess(i8* %arg0,i8* %arg1, i32 %arg2)