2013-02-11 08:34:57 +00:00
|
|
|
; RUN: opt < %s -basicaa -functionattrs -S | FileCheck %s
|
2008-09-19 09:20:05 +00:00
|
|
|
@x = global i32 0
|
|
|
|
|
2013-02-20 07:21:42 +00:00
|
|
|
; CHECK: declare i32 @e() #0
|
2008-09-19 09:20:05 +00:00
|
|
|
declare i32 @e() readnone
|
2008-09-03 15:31:24 +00:00
|
|
|
|
2013-02-20 07:21:42 +00:00
|
|
|
; CHECK: define i32 @f() #0
|
2008-09-03 15:31:24 +00:00
|
|
|
define i32 @f() {
|
|
|
|
%tmp = call i32 @e( ) ; <i32> [#uses=1]
|
|
|
|
ret i32 %tmp
|
|
|
|
}
|
|
|
|
|
2013-02-20 07:21:42 +00:00
|
|
|
; CHECK: define i32 @g() #0
|
2008-09-19 09:20:05 +00:00
|
|
|
define i32 @g() readonly {
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
2013-02-20 07:21:42 +00:00
|
|
|
; CHECK: define i32 @h() #0
|
2008-09-19 09:20:05 +00:00
|
|
|
define i32 @h() readnone {
|
|
|
|
%tmp = load i32* @x ; <i32> [#uses=1]
|
|
|
|
ret i32 %tmp
|
|
|
|
}
|
2013-02-20 07:21:42 +00:00
|
|
|
|
|
|
|
; CHECK: attributes #0 = { readnone }
|