1 ; RUN: opt -passes="ipsccp<func-spec>" -force-specialization -S < %s | FileCheck %s
3 ; CHECK-NOT: foo.specialized.{{[0-9]+}}
5 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
7 @A = external dso_local constant i32, align 4
8 @B = external dso_local constant i32, align 4
9 @C = external dso_local constant i32, align 4
10 @D = external dso_local constant i32, align 4
12 declare i1 @cond_begin()
13 declare i1 @cond_end()
16 define internal i32 @foo(i32 %x, ptr %b, ptr %c) alwaysinline {
27 %0 = load i32, ptr %b, align 4
28 %1 = load i32, ptr %c, align 4
29 %add.0 = add nsw i32 %0, %1
30 %add = add nsw i32 %add.0, %x
34 %cond.end = call i1 @cond_end()
35 br i1 %cond.end, label %loop2.entry, label %loop.end
38 %cond2.end = call i1 @getCond()
39 br i1 %cond2.end, label %loop.entry, label %return
45 define dso_local i32 @bar(i32 %x, i32 %y) {
47 %tobool = icmp ne i32 %x, 0
48 br i1 %tobool, label %if.then, label %if.else
51 %call = call i32 @foo(i32 %x, ptr @A, ptr @C)
55 %call1 = call i32 @foo(i32 %y, ptr @B, ptr @D)
59 %retval.0 = phi i32 [ %call, %if.then ], [ %call1, %if.else ]