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
8 define hidden i64 @f1() align 2 {
9 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
10 ; TUNIT-LABEL: define {{[^@]+}}@f1
11 ; TUNIT-SAME: () #[[ATTR0:[0-9]+]] align 2 {
13 ; TUNIT-NEXT: ret i64 undef
15 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
16 ; CGSCC-LABEL: define {{[^@]+}}@f1
17 ; CGSCC-SAME: () #[[ATTR0:[0-9]+]] align 2 {
19 ; CGSCC-NEXT: [[REF_TMP:%.*]] = alloca [[A:%.*]], align 8
20 ; CGSCC-NEXT: [[CALL2:%.*]] = call i64 @f2() #[[ATTR2:[0-9]+]]
21 ; CGSCC-NEXT: ret i64 [[CALL2]]
24 %ref.tmp = alloca %"a", align 8
25 %call2 = call i64 @f2(ptr %ref.tmp)
29 define internal i64 @f2(ptr %this) align 2 {
30 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
31 ; CGSCC-LABEL: define {{[^@]+}}@f2
32 ; CGSCC-SAME: () #[[ATTR0]] align 2 {
34 ; CGSCC-NEXT: ret i64 undef
37 %this.addr = alloca ptr, align 8
38 store ptr %this, ptr %this.addr, align 8
39 %this1 = load ptr, ptr %this.addr, align 8
40 call void @f3(ptr %this1)
44 define internal void @f3(ptr %this) align 2 {
45 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
46 ; CGSCC-LABEL: define {{[^@]+}}@f3
47 ; CGSCC-SAME: () #[[ATTR0]] align 2 {
49 ; CGSCC-NEXT: ret void
52 %this.addr = alloca ptr, align 8
53 store ptr %this, ptr %this.addr, align 8
54 %this1 = load ptr, ptr %this.addr, align 8
55 %call = call i1 @f4(ptr %this1)
59 define internal i1 @f4(ptr %this) align 2 {
60 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
61 ; CGSCC-LABEL: define {{[^@]+}}@f4
62 ; CGSCC-SAME: () #[[ATTR0]] align 2 {
64 ; CGSCC-NEXT: ret i1 undef
67 %this.addr = alloca ptr, align 8
68 store ptr %this, ptr %this.addr, align 8
69 %this1 = load ptr, ptr %this.addr, align 8
70 %call = call ptr @f5(ptr %this1)
74 define internal ptr @f5(ptr %this) align 2 {
75 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
76 ; CGSCC-LABEL: define {{[^@]+}}@f5
77 ; CGSCC-SAME: () #[[ATTR1:[0-9]+]] align 2 {
79 ; CGSCC-NEXT: ret ptr undef
82 %this.addr = alloca ptr, align 8
83 store ptr %this, ptr %this.addr, align 8
84 %this1 = load ptr, ptr %this.addr, align 8
88 ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
90 ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
91 ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
92 ; CGSCC: attributes #[[ATTR2]] = { nofree nosync willreturn }
94 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: