1 ; RUN: opt < %s -simplifycfg -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, i32* %out) {
11 %out1 = getelementptr i32, i32* %out, i32 1
12 %out2 = getelementptr i32, i32* %out, i32 2
13 %cmp = icmp eq i32 %cond, 0
14 br i1 %cmp, label %if.then, label %if.end
17 store i32 5, i32* %out
21 call void @barrier() #0
22 br i1 %cmp, label %cond.end, label %cond.false
25 store i32 5, i32* %out1
29 %value = phi i32 [ 1, %cond.false ], [ 0, %if.end ]
30 store i32 %value, i32* %out2
34 ; Function Attrs: noduplicate nounwind
35 declare void @barrier() #0
37 attributes #0 = { noduplicate nounwind }