blob: 55a72a5b29f540a00cd3473b5b41e65bb50f6067 [file] [log] [blame]
Dan Gohman5bb7c7c2009-09-08 22:34:10 +00001; RUN: opt %s -functionattrs -S | grep readnone | count 4
Duncan Sandsbc5ce932008-09-19 09:20:05 +00002@x = global i32 0
3
4declare i32 @e() readnone
Duncan Sands58f38772008-09-19 08:17:05 +00005
6define i32 @f() {
Duncan Sands58f38772008-09-19 08:17:05 +00007 %tmp = call i32 @e( ) ; <i32> [#uses=1]
8 ret i32 %tmp
9}
10
Duncan Sandsbc5ce932008-09-19 09:20:05 +000011define i32 @g() readonly {
12 ret i32 0
13}
14
15define i32 @h() readnone {
16 %tmp = load i32* @x ; <i32> [#uses=1]
17 ret i32 %tmp
18}