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%T = type { i32, i32, i32, i32 }6@G = constant %T { i32 0, i32 0, i32 17, i32 25 }7 8;.9; CHECK: @G = constant %T { i32 0, i32 0, i32 17, i32 25 }10;.11define internal i32 @test(ptr %p) {12; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)13; CGSCC-LABEL: define {{[^@]+}}@test14; CGSCC-SAME: () #[[ATTR0:[0-9]+]] {15; CGSCC-NEXT: entry:16; CGSCC-NEXT: ret i32 4217;18entry:19 %a.gep = getelementptr %T, ptr %p, i64 0, i32 320 %b.gep = getelementptr %T, ptr %p, i64 0, i32 221 %a = load i32, ptr %a.gep22 %b = load i32, ptr %b.gep23 %v = add i32 %a, %b24 ret i32 %v25}26 27define i32 @caller() {28;29; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)30; TUNIT-LABEL: define {{[^@]+}}@caller31; TUNIT-SAME: () #[[ATTR0:[0-9]+]] {32; TUNIT-NEXT: entry:33; TUNIT-NEXT: ret i32 4234;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: [[V:%.*]] = call noundef i32 @test() #[[ATTR2:[0-9]+]]40; CGSCC-NEXT: ret i32 [[V]]41;42entry:43 %v = call i32 @test(ptr @G)44 ret i32 %v45}46;.47; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }48;.49; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }50; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }51; CGSCC: attributes #[[ATTR2]] = { nofree nosync willreturn }52;.53;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:54; CHECK: {{.*}}55