1 ; RUN: opt -function-specialization -force-function-specialization -func-specialization-max-iters=2 -S < %s | FileCheck %s
3 ; Duplicate store preventing recursive specialisation:
5 ; CHECK: @recursiveFunc.1
6 ; CHECK-NOT: @recursiveFunc.2
8 @Global = internal constant i32 1, align 4
10 define internal void @recursiveFunc(i32* nocapture readonly %arg) {
11 %temp = alloca i32, align 4
12 %arg.load = load i32, i32* %arg, align 4
13 %arg.cmp = icmp slt i32 %arg.load, 4
14 br i1 %arg.cmp, label %block6, label %ret.block
17 call void @print_val(i32 %arg.load)
18 %arg.add = add nsw i32 %arg.load, 1
19 store i32 %arg.add, i32* %temp, align 4
20 store i32 %arg.add, i32* %temp, align 4
21 call void @recursiveFunc(i32* nonnull %temp)
30 call void @recursiveFunc(i32* nonnull @Global)
34 declare dso_local void @print_val(i32)