blob: 47226dd8da7a15f50cb0602d2393d84081809cb7 [file] [log] [blame]
Dan Gohman3c7d3082009-09-11 18:01:28 +00001; RUN: opt < %s -anders-aa -aa-eval 2>/dev/null
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
Tanya Lattnera695f012008-02-14 06:56:27 +00003define void @test1() {
4 %X = malloc i32*
5 %Y = malloc i32
6 %Z = ptrtoint i32* %Y to i32
7 %W = inttoptr i32 %Z to i32*
8 store i32* %W, i32** %X
Dan Gohmanf17a25c2007-07-18 16:29:46 +00009 ret void
10}
11
Tanya Lattnera695f012008-02-14 06:56:27 +000012define void @test2(i32* %P) {
13 %X = malloc i32*
14 %Y = malloc i32
15 store i32* %P, i32** %X
Dan Gohmanf17a25c2007-07-18 16:29:46 +000016 ret void
17}
18
Tanya Lattnera695f012008-02-14 06:56:27 +000019define internal i32 *@test3(i32* %P) {
20 ret i32* %P
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021}
22
Tanya Lattnera695f012008-02-14 06:56:27 +000023define void @test4() {
24 %X = malloc i32
25 %Y = call i32* @test3(i32* %X)
26 %ZZ = getelementptr i32* null, i32 17
Dan Gohmanf17a25c2007-07-18 16:29:46 +000027 ret void
28}