2013-02-11 16:34:57 +08:00
|
|
|
; RUN: opt < %s -basicaa -functionattrs -S | FileCheck %s
|
2018-03-24 05:46:16 +08:00
|
|
|
; RUN: opt < %s -aa-pipeline=basic-aa -passes=function-attrs -S | FileCheck %s
|
|
|
|
|
2008-09-19 17:20:05 +08:00
|
|
|
@x = global i32 0
|
|
|
|
|
2018-03-24 05:46:16 +08:00
|
|
|
; CHECK: Function Attrs
|
|
|
|
; CHECK-SAME: readnone
|
|
|
|
; CHECK-NEXT: declare i32 @e
|
2008-09-19 17:20:05 +08:00
|
|
|
declare i32 @e() readnone
|
2008-09-03 23:31:24 +08:00
|
|
|
|
2018-03-24 05:46:16 +08:00
|
|
|
; CHECK: Function Attrs
|
|
|
|
; CHECK-SAME: readnone
|
|
|
|
; CHECK-NEXT: define i32 @f
|
2008-09-03 23:31:24 +08:00
|
|
|
define i32 @f() {
|
|
|
|
%tmp = call i32 @e( ) ; <i32> [#uses=1]
|
|
|
|
ret i32 %tmp
|
|
|
|
}
|
|
|
|
|
2018-03-24 05:46:16 +08:00
|
|
|
; CHECK: Function Attrs
|
|
|
|
; CHECK-SAME: readnone
|
|
|
|
; CHECK-NEXT: define i32 @g
|
2008-09-19 17:20:05 +08:00
|
|
|
define i32 @g() readonly {
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
2018-03-24 05:46:16 +08:00
|
|
|
; CHECK: Function Attrs
|
|
|
|
; CHECK-SAME: readnone
|
|
|
|
; CHECK-NEXT: define i32 @h
|
2008-09-19 17:20:05 +08:00
|
|
|
define i32 @h() readnone {
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load i32, i32* @x ; <i32> [#uses=1]
|
2008-09-19 17:20:05 +08:00
|
|
|
ret i32 %tmp
|
|
|
|
}
|