1 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
3 ; This test checks that the SimplifyCFG pass won't duplicate a call to a
4 ; function marked noduplicate.
6 ; CHECK-LABEL: @noduplicate
7 ; CHECK: call void @barrier
8 ; CHECK-NOT: call void @barrier
9 define void @noduplicate(i32 %cond, ptr %out) {
11 %out1 = getelementptr i32, ptr %out, i32 1
12 %out2 = getelementptr i32, ptr %out, i32 2
13 %cmp = icmp eq i32 %cond, 0
14 br i1 %cmp, label %if.then, label %if.end
21 call void @barrier() #0
22 br i1 %cmp, label %cond.end, label %cond.false
25 store i32 5, ptr %out1
29 %value = phi i32 [ 1, %cond.false ], [ 0, %if.end ]
30 store i32 %value, ptr %out2
34 ; Function Attrs: noduplicate nounwind
35 declare void @barrier() #0
37 attributes #0 = { noduplicate nounwind }