blob: 61297b615963e97337a8e33734615f1222e77fe7 [file] [log] [blame]
Dan Gohman3e054fe2009-09-08 22:34:10 +00001; RUN: opt %s -globalsmodref-aa -gvn -S | grep call | count 2
Duncan Sands9a036b92008-09-03 12:55:42 +00002
3@g = internal global i32 0 ; <i32*> [#uses=2]
4
5define i32 @r() {
6 %tmp = load i32* @g ; <i32> [#uses=1]
7 ret i32 %tmp
8}
9
10define i32 @f() {
11entry:
12 %tmp = call i32 @e( ) ; <i32> [#uses=1]
13 store i32 %tmp, i32* @g
14 %tmp2 = call i32 @e( ) ; <i32> [#uses=1]
15 ret i32 %tmp2
16}
17
18declare i32 @e() readonly ; might call @r