xref: /llvm-project/llvm/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll (revision 304f1d59ca41872c094def3aee0a8689df6aa398)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes
2; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
3
4define i32 @f() {
5; CHECK: Function Attrs: nofree memory(read)
6; CHECK-LABEL: @f(
7; CHECK-NEXT:  entry:
8; CHECK-NEXT:    [[TMP:%.*]] = call i32 @e()
9; CHECK-NEXT:    ret i32 [[TMP]]
10;
11entry:
12  %tmp = call i32 @e( )
13  ret i32 %tmp
14}
15
16declare i32 @e() readonly
17