Fix test.
[oota-llvm.git] / test / Transforms / PartialSpecialize / heuristics.ll
1 ; If there are not enough callsites for a particular specialization to
2 ; justify its existence, the specialization shouldn't be created.
3 ;
4 ; RUN: opt -S -partialspecialization -disable-inlining %s | FileCheck %s 
5 declare void @callback1()
6 declare void @callback2()
7
8 declare void @othercall()
9
10 define internal void @UseCallback(void()* %pCallback) {
11   call void %pCallback()
12   call void @othercall()
13   call void @othercall()
14   call void @othercall()
15   call void @othercall()
16   call void @othercall()
17   call void @othercall()
18   call void @othercall()
19   call void @othercall()
20   call void @othercall()
21   call void @othercall()
22   call void @othercall()
23   call void @othercall()
24   call void @othercall()
25   call void @othercall()
26   call void @othercall()
27   call void @othercall()
28   call void @othercall()
29   call void @othercall()
30   ret void
31 }
32
33 define void @foo(void()* %pNonConstCallback)
34 {
35 Entry:
36 ; CHECK: Entry
37 ; CHECK-NOT: call void @UseCallback(void ()* @callback1)
38 ; CHECK: call void @UseCallback(void ()* @callback2)
39 ; CHECK-NEXT: call void @UseCallback(void ()* @callback2)
40 ; CHECK-NEXT: ret void
41   call void @UseCallback(void()* @callback1)
42   call void @UseCallback(void()* @callback1)
43   call void @UseCallback(void()* @callback1)
44   call void @UseCallback(void()* @callback1)
45   call void @UseCallback(void()* @callback2)
46   call void @UseCallback(void()* @callback2)
47
48   ret void
49 }