xref: /llvm-project/llvm/test/tools/llvm-reduce/remove-funcs.ll (revision 1437a83491cbe4af1b452a3f862a6b609057c26d)
1; Test that llvm-reduce can remove uninteresting functions as well as
2; their InstCalls.
3;
4; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=functions,instructions --test FileCheck --test-arg --check-prefixes=CHECK-ALL,CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
5; RUN: cat %t | FileCheck -implicit-check-not=uninteresting --check-prefixes=CHECK-ALL,CHECK-FINAL %s
6
7define i32 @uninteresting1() {
8entry:
9  ret i32 0
10}
11
12; CHECK-ALL-LABEL: interesting()
13define i32 @interesting() {
14entry:
15  ; CHECK-INTERESTINGNESS: call i32 @interesting()
16  %call2 = call i32 @interesting()
17  %call = call i32 @uninteresting1()
18  ret i32 5
19}
20
21; CHECK-FINAL-NEXT: entry:
22; CHECK-FINAL-NEXT:   %call2 = call i32 @interesting()
23; CHECK-FINAL-NEXT:   ret i32 5
24; CHECK-FINAL-NEXT: }
25
26define i32 @uninteresting2() {
27entry:
28  ret i32 0
29}
30
31declare void @uninteresting3()
32