55 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals2; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT3; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC4 5@G1 = constant i32 06@G2 = constant ptr @G17 8;.9; CHECK: @G1 = constant i32 010; CHECK: @G2 = constant ptr @G111;.12define internal i32 @test(ptr %x) {13;14; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)15; CHECK-LABEL: define {{[^@]+}}@test16; CHECK-SAME: () #[[ATTR0:[0-9]+]] {17; CHECK-NEXT: entry:18; CHECK-NEXT: [[Z:%.*]] = load i32, ptr @G1, align 419; CHECK-NEXT: ret i32 [[Z]]20;21entry:22 %y = load ptr, ptr %x23 %z = load i32, ptr %y24 ret i32 %z25}26 27define i32 @caller() {28; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)29; TUNIT-LABEL: define {{[^@]+}}@caller30; TUNIT-SAME: () #[[ATTR0]] {31; TUNIT-NEXT: entry:32; TUNIT-NEXT: [[X:%.*]] = call i32 @test() #[[ATTR1:[0-9]+]]33; TUNIT-NEXT: ret i32 [[X]]34;35; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)36; CGSCC-LABEL: define {{[^@]+}}@caller37; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {38; CGSCC-NEXT: entry:39; CGSCC-NEXT: [[X:%.*]] = call i32 @test() #[[ATTR2:[0-9]+]]40; CGSCC-NEXT: ret i32 [[X]]41;42entry:43 %x = call i32 @test(ptr @G2)44 ret i32 %x45}46 47;.48; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }49; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn memory(read) }50;.51; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }52; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }53; CGSCC: attributes #[[ATTR2]] = { nofree nosync willreturn }54;.55