1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00
llvm-mirror/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll
Eric Christopher a62270de2c Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory.

Will be re-reverting again.

llvm-svn: 358552
2019-04-17 04:52:47 +00:00

33 lines
691 B
LLVM

; RUN: opt < %s -basicaa -functionattrs -S | FileCheck %s
; RUN: opt < %s -aa-pipeline=basic-aa -passes=function-attrs -S | FileCheck %s
@x = global i32 0
; CHECK: Function Attrs
; CHECK-SAME: readnone
; CHECK-NEXT: declare i32 @e
declare i32 @e() readnone
; CHECK: Function Attrs
; CHECK-SAME: readnone
; CHECK-NEXT: define i32 @f
define i32 @f() {
%tmp = call i32 @e( ) ; <i32> [#uses=1]
ret i32 %tmp
}
; CHECK: Function Attrs
; CHECK-SAME: readnone
; CHECK-NEXT: define i32 @g
define i32 @g() readonly {
ret i32 0
}
; CHECK: Function Attrs
; CHECK-SAME: readnone
; CHECK-NEXT: define i32 @h
define i32 @h() readnone {
%tmp = load i32, i32* @x ; <i32> [#uses=1]
ret i32 %tmp
}