1; RUN: opt -S -instcombine < %s | FileCheck %s
2
3declare void @readnone_but_may_throw() readnone
4
5define void @f_0(i32* %ptr) {
6; CHECK-LABEL: @f_0(
7entry:
8; CHECK:  store i32 10, i32* %ptr
9; CHECK-NEXT:  call void @readnone_but_may_throw()
10; CHECK-NEXT:  store i32 20, i32* %ptr, align 4
11; CHECK:  ret void
12
13  store i32 10, i32* %ptr
14  call void @readnone_but_may_throw()
15  store i32 20, i32* %ptr
16  ret void
17}
18
19define void @f_1(i1 %cond, i32* %ptr) {
20; CHECK-LABEL: @f_1(
21; CHECK:  store i32 10, i32* %ptr
22; CHECK-NEXT:  call void @readnone_but_may_throw()
23
24  store i32 10, i32* %ptr
25  call void @readnone_but_may_throw()
26  br i1 %cond, label %left, label %merge
27
28left:
29  store i32 20, i32* %ptr
30  br label %merge
31
32merge:
33  ret void
34}
35