summaryrefslogtreecommitdiffstats
path: root/llvm/test/Reduce/remove-funcs.ll
blob: 6125f7f1180177a2f12437632e80c6f319753257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
; Test that llvm-reduce can remove uninteresting functions as well as
; their InstCalls.
;
; RUN: llvm-reduce --test %p/Inputs/remove-funcs.sh %s
; RUN: cat reduced.ll | FileCheck %s
; REQUIRES: plugins, shell

; CHECK-NOT: uninteresting1()
define i32 @uninteresting1() {
entry:
  ret i32 0
}

; CHECK: interesting()
define i32 @interesting() {
entry:
  ; CHECK: call i32 @interesting()
  %call2 = call i32 @interesting()
  ; CHECK-NOT: call i32 @uninteresting1()
  %call = call i32 @uninteresting1()
  ret i32 5
}

; CHECK-NOT: uninteresting2()
define i32 @uninteresting2() {
entry:
  ret i32 0
}

; CHECK-NOT: uninteresting3()
define i32 @uninteresting3() {
entry:
  ret i32 10
}
OpenPOWER on IntegriCloud