1 ; RUN: opt -passes="ipsccp<func-spec>" -force-specialization -funcspec-max-iters=2 -funcspec-max-clones=1 -funcspec-for-literal-constant=true -S < %s | FileCheck %s
3 declare hidden i1 @compare(ptr) align 2
4 declare hidden { i8, ptr } @getType(ptr) align 2
7 ; CHECK-LABEL: @foo.specialized.1
8 ; CHECK-LABEL: @foo.specialized.2
10 define internal void @foo(ptr %TLI, ptr %DL, ptr %Ty, ptr %ValueVTs, ptr %Offsets, i64 %StartingOffset) {
12 %VT = alloca i64, align 8
13 br i1 false, label %if.then, label %if.end4
15 if.then: ; preds = %entry
18 if.end4: ; preds = %entry
19 %cmp = call zeroext i1 @compare(ptr undef)
20 br i1 %cmp, label %for.body, label %for.cond16
22 for.body: ; preds = %if.end4
23 %add13 = add i64 %StartingOffset, undef
24 call void @foo(ptr %TLI, ptr %DL, ptr undef, ptr %ValueVTs, ptr %Offsets, i64 %add13)
27 for.cond16: ; preds = %for.cond34, %if.end4
28 %call27 = call { i8, ptr } @getType(ptr %VT)
31 for.cond34: ; preds = %for.body37, %for.cond16
32 br i1 undef, label %for.body37, label %for.cond16
34 for.body37: ; preds = %for.cond34
35 %tobool39 = icmp ne ptr %Offsets, null
39 define hidden { ptr, i32 } @bar(ptr %this) {
41 %Offsets = alloca i64, align 8
42 %cmp26 = call zeroext i1 @compare(ptr undef)
43 br i1 %cmp26, label %for.body28, label %for.cond.cleanup27
45 for.cond.cleanup27: ; preds = %entry
46 ret { ptr, i32 } undef
48 for.body28: ; preds = %entry
49 %call33 = call zeroext i1 @compare(ptr undef)
50 br i1 %call33, label %if.then34, label %if.end106
52 if.then34: ; preds = %for.body28
53 call void @foo(ptr %this, ptr undef, ptr undef, ptr undef, ptr null, i64 0)
56 if.end106: ; preds = %for.body28
57 call void @foo(ptr %this, ptr undef, ptr undef, ptr undef, ptr %Offsets, i64 0)