1; RUN: opt -sink -S < %s | FileCheck %s
2
3; Verify that IR sinking does not move convergent operations to
4; blocks that are not control equivalent.
5
6; CHECK: define i32 @foo
7; CHECK: entry
8; CHECK-NEXT: call i32 @bar
9; CHECK-NEXT: br i1 %arg
10
11define i32 @foo(i1 %arg) {
12entry:
13  %c = call i32 @bar() readonly convergent
14  br i1 %arg, label %then, label %end
15
16then:
17  ret i32 %c
18
19end:
20  ret i32 0
21}
22
23declare i32 @bar() readonly convergent
24