blob: ecc6bcc55d1dc5ba27510344a6b60b6b4fdf3e99 [file] [log] [blame]
Chandler Carruth7b560d42015-09-09 17:55:00 +00001; RUN: opt < %s -basicaa -globals-aa -gvn -S -enable-unsafe-globalsmodref-alias-results | FileCheck %s
Chandler Carruthf55803f2015-07-17 06:58:24 +00002;
3; Note that this test relies on an unsafe feature of GlobalsModRef. While this
4; test is correct and safe, GMR's technique for handling this isn't generally.
Bill Wendling1981c0e2012-04-24 10:45:44 +00005
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00006@X = internal global i32 4 ; <i32*> [#uses=1]
Chris Lattnere30d3c822004-07-27 06:26:08 +00007
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00008define i32 @test(i32* %P) {
Bill Wendling1981c0e2012-04-24 10:45:44 +00009; CHECK: @test
10; CHECK-NEXT: store i32 7, i32* %P
11; CHECK-NEXT: store i32 12, i32* @X
12; CHECK-NEXT: ret i32 7
Tanya Lattnerf865dcd2008-02-14 06:56:27 +000013 store i32 7, i32* %P
14 store i32 12, i32* @X
David Blaikiea79ac142015-02-27 21:17:42 +000015 %V = load i32, i32* %P ; <i32> [#uses=1]
Tanya Lattnerf865dcd2008-02-14 06:56:27 +000016 ret i32 %V
Chris Lattnere30d3c822004-07-27 06:26:08 +000017}