xref: /llvm-project/llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll (revision 47f0b6630c78ab52c2197ec5e1c2d13a6acffed1)
1; RUN: opt < %s -aa-pipeline=basic-aa,globals-aa -passes=gvn -S | FileCheck %s
2
3; See PR26774
4
5@X = internal global i32 4
6
7define i32 @test(ptr %P) {
8; CHECK:      @test
9; CHECK-NEXT: store i32 12, ptr @X
10; CHECK-NEXT: call void @doesnotmodX()
11; CHECK-NEXT:  %V = load i32, ptr @X
12; CHECK-NEXT:  ret i32 %V
13  store i32 12, ptr @X
14  call void @doesnotmodX( )
15  %V = load i32, ptr @X
16  ret i32 %V
17}
18
19define linkonce_odr void @doesnotmodX() {
20  ret void
21}
22