1; Intrinsic calls can't be uniformly replaced with undef without invalidating
2; IR (eg: only intrinsic calls can have metadata arguments), so ensure they are
3; not replaced. The whole call instruction can be removed by instruction
4; reduction instead.
5
6; RUN: llvm-reduce --test FileCheck --test-arg --check-prefixes=ALL,CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
7; RUN: cat %t | FileCheck -implicit-check-not=uninteresting --check-prefixes=ALL,CHECK-FINAL %s
8
9; Check that the call is removed by instruction reduction passes
10; RUN: llvm-reduce --test FileCheck --test-arg --check-prefixes=ALL,CHECK-FUNC --test-arg %s --test-arg --input-file %s -o %t
11; RUN: cat %t | FileCheck -implicit-check-not=uninteresting --check-prefixes=ALL,CHECK-NOCALL %s
12
13
14declare i8* @llvm.sponentry.p0i8()
15declare void @uninteresting()
16
17; ALL-LABEL: define i8* @interesting(
18define i8* @interesting() {
19entry:
20  ; CHECK-INTERESTINGNESS: call
21  ; CHECK-NOCALL-NOT: call
22
23  ; CHECK-FINAL: %call = call i8* @llvm.sponentry.p0i8()
24  ; CHECK-FINAL-NEXT: ret i8* %call
25  %call = call i8* @llvm.sponentry.p0i8()
26  call void @uninteresting()
27  ret i8* %call
28}
29