brintos

brintos / llvm-project-archived public Read only

0
0
Text · 878 B · ee8437e Raw
35 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes2; RUN: opt < %s -passes=function-attrs -S | FileCheck %s3 4@x = global i32 05 6declare i32 @e() readnone7 8define i32 @f() {9; CHECK: Function Attrs: nofree nosync memory(none)10; CHECK-LABEL: @f(11; CHECK-NEXT:    [[TMP:%.*]] = call i32 @e()12; CHECK-NEXT:    ret i32 [[TMP]]13;14  %tmp = call i32 @e()15  ret i32 %tmp16}17 18define i32 @g() readonly {19; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)20; CHECK-LABEL: @g(21; CHECK-NEXT:    ret i32 022;23  ret i32 024}25 26define i32 @h() readnone {27; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)28; CHECK-LABEL: @h(29; CHECK-NEXT:    [[TMP:%.*]] = load i32, ptr @x, align 430; CHECK-NEXT:    ret i32 [[TMP]]31;32  %tmp = load i32, ptr @x33  ret i32 %tmp34}35