1; RUN: opt < %s -basic-aa -globals-aa -gvn -enable-new-pm=0 -S | FileCheck %s
2; RUN: opt < %s -basic-aa -globals-aa -gvn -enable-new-pm=1 -S | FileCheck %s
3
4; See PR26774
5
6@X = internal global i32 4
7
8define i32 @test(i32* %P) {
9; CHECK:      @test
10; CHECK-NEXT: store i32 12, i32* @X
11; CHECK-NEXT: call void @doesnotmodX()
12; CHECK-NEXT:  %V = load i32, i32* @X
13; CHECK-NEXT:  ret i32 %V
14  store i32 12, i32* @X
15  call void @doesnotmodX( )
16  %V = load i32, i32* @X
17  ret i32 %V
18}
19
20define linkonce_odr void @doesnotmodX() {
21  ret void
22}
23