1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
5 %T = type { i32, i32, i32, i32 }
6 @G = constant %T { i32 0, i32 0, i32 17, i32 25 }
9 ; CHECK: @G = constant %T { i32 0, i32 0, i32 17, i32 25 }
11 define internal i32 @test(ptr %p) {
12 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
13 ; CGSCC-LABEL: define {{[^@]+}}@test
14 ; CGSCC-SAME: () #[[ATTR0:[0-9]+]] {
16 ; CGSCC-NEXT: ret i32 42
19 %a.gep = getelementptr %T, ptr %p, i64 0, i32 3
20 %b.gep = getelementptr %T, ptr %p, i64 0, i32 2
21 %a = load i32, ptr %a.gep
22 %b = load i32, ptr %b.gep
27 define i32 @caller() {
29 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
30 ; TUNIT-LABEL: define {{[^@]+}}@caller
31 ; TUNIT-SAME: () #[[ATTR0:[0-9]+]] {
33 ; TUNIT-NEXT: ret i32 42
35 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
36 ; CGSCC-LABEL: define {{[^@]+}}@caller
37 ; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
39 ; CGSCC-NEXT: [[V:%.*]] = call noundef i32 @test() #[[ATTR2:[0-9]+]]
40 ; CGSCC-NEXT: ret i32 [[V]]
43 %v = call i32 @test(ptr @G)
47 ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
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 }
53 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: