blob: 3a0eee84e881c0255a73ace5d76245c2fd5ca0f0 [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 Carruth45a9c202016-03-11 09:15:11 +00002; RUN: opt < %s -aa-pipeline=basic-aa,globals-aa -passes="require<globals-aa>,function(gvn)" -S -enable-unsafe-globalsmodref-alias-results | FileCheck %s
Chandler Carruthf55803f2015-07-17 06:58:24 +00003;
4; Note that this test relies on an unsafe feature of GlobalsModRef. While this
5; test is correct and safe, GMR's technique for handling this isn't generally.
Bill Wendling1981c0e2012-04-24 10:45:44 +00006
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00007@X = internal global i32 4 ; <i32*> [#uses=1]
Chris Lattnere30d3c822004-07-27 06:26:08 +00008
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00009define i32 @test(i32* %P) {
Bill Wendling1981c0e2012-04-24 10:45:44 +000010; CHECK: @test
11; CHECK-NEXT: store i32 7, i32* %P
12; CHECK-NEXT: store i32 12, i32* @X
13; CHECK-NEXT: ret i32 7
Tanya Lattnerf865dcd2008-02-14 06:56:27 +000014 store i32 7, i32* %P
15 store i32 12, i32* @X
David Blaikiea79ac142015-02-27 21:17:42 +000016 %V = load i32, i32* %P ; <i32> [#uses=1]
Tanya Lattnerf865dcd2008-02-14 06:56:27 +000017 ret i32 %V
Chris Lattnere30d3c822004-07-27 06:26:08 +000018}