1 ; RUN: opt -passes="ipsccp<func-spec>" -force-specialization -funcspec-max-iters=2 -S < %s | FileCheck %s
3 ; Volatile store preventing recursive specialisation:
5 ; CHECK: @recursiveFunc.specialized.1
6 ; CHECK-NOT: @recursiveFunc.specialized.2
8 @Global = internal constant i32 1, align 4
10 define internal void @recursiveFunc(ptr nocapture readonly %arg) {
11 %temp = alloca i32, align 4
12 %arg.load = load i32, ptr %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 volatile i32 %arg.add, ptr %temp, align 4
20 call void @recursiveFunc(ptr nonnull %temp)
28 call void @recursiveFunc(ptr nonnull @Global)
32 declare dso_local void @print_val(i32)