1 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=operands-skip --test FileCheck --test-arg --check-prefixes=INTERESTING --test-arg %s --test-arg --input-file %s -o %t
2 ; RUN: FileCheck --check-prefixes=CHECK %s < %t
4 ; Make sure address captures of intrinsics are not introduced.
8 declare ptr @fptr.keep()
9 declare ptr @llvm.intrin()
10 declare ptr @llvm.intrin.keep()
11 declare void @func(i32, ptr)
13 declare ptr @llvm.intrin2()
14 declare ptr @llvm.intrin.chain(ptr)
16 ; INTERESTING-LABEL: define void @caller(
17 ; INTERESTING: call void @func(i32 1
18 ; INTERESTING: call void @func(i32 3
19 ; INTERESTING: call void @func(i32 4
20 ; INTERESTING: call void @func(i32 5
22 ; CHECK: %intrin.ptr.keep = call ptr @llvm.intrin.keep()
24 ; CHECK: call void @func(i32 0, ptr @fptr)
25 ; CHECK: call void @func(i32 1, ptr @fptr.keep)
26 ; CHECK: call void @func(i32 2, ptr %intrin.ptr)
27 ; CHECK: call void @func(i32 3, ptr %intrin.ptr.keep)
28 ; CHECK: call void @func(i32 4, ptr %intrin.ptr.keep)
29 ; CHECK: call void @func(i32 5, ptr %chained.ptr)
30 define void @caller() {
31 %func.ptr = call ptr @fptr()
32 %func.ptr.keep = call ptr @fptr.keep()
33 %intrin.ptr = call ptr @llvm.intrin()
34 %intrin.ptr.keep = call ptr @llvm.intrin.keep()
35 %gep = getelementptr i8, ptr %intrin.ptr.keep, i64 128
36 %chained.ptr = call ptr @llvm.intrin2()
37 %chain.ptr = call ptr @llvm.intrin.chain(ptr %chained.ptr)
38 call void @func(i32 0, ptr %func.ptr)
39 call void @func(i32 1, ptr %func.ptr.keep)
40 call void @func(i32 2, ptr %intrin.ptr)
41 call void @func(i32 3, ptr %intrin.ptr.keep)
42 call void @func(i32 4, ptr %gep)
43 call void @func(i32 5, ptr %chain.ptr)