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: [[REF_TMP1:%.*]] = alloca i8, i32 0, align 8
14 ; TUNIT-NEXT: ret i64 undef
16 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
17 ; CGSCC-LABEL: define {{[^@]+}}@f1
18 ; CGSCC-SAME: () #[[ATTR0:[0-9]+]] align 2 {
20 ; CGSCC-NEXT: [[REF_TMP:%.*]] = alloca [[A:%.*]], align 8
21 ; CGSCC-NEXT: [[REF_TMP1:%.*]] = alloca i8, i32 0, align 8
22 ; CGSCC-NEXT: [[CALL2:%.*]] = call i64 @f2() #[[ATTR2:[0-9]+]]
23 ; CGSCC-NEXT: ret i64 [[CALL2]]
26 %ref.tmp = alloca %"a", align 8
27 %call2 = call i64 @f2(ptr %ref.tmp)
31 define internal i64 @f2(ptr %this) align 2 {
32 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
33 ; CGSCC-LABEL: define {{[^@]+}}@f2
34 ; CGSCC-SAME: () #[[ATTR0]] align 2 {
36 ; CGSCC-NEXT: ret i64 undef
39 %this.addr = alloca ptr, align 8
40 store ptr %this, ptr %this.addr, align 8
41 %this1 = load ptr, ptr %this.addr, align 8
42 call void @f3(ptr %this1)
46 define internal void @f3(ptr %this) align 2 {
47 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
48 ; CGSCC-LABEL: define {{[^@]+}}@f3
49 ; CGSCC-SAME: () #[[ATTR0]] align 2 {
51 ; CGSCC-NEXT: ret void
54 %this.addr = alloca ptr, align 8
55 store ptr %this, ptr %this.addr, align 8
56 %this1 = load ptr, ptr %this.addr, align 8
57 %call = call i1 @f4(ptr %this1)
61 define internal i1 @f4(ptr %this) align 2 {
62 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
63 ; CGSCC-LABEL: define {{[^@]+}}@f4
64 ; CGSCC-SAME: () #[[ATTR0]] align 2 {
66 ; CGSCC-NEXT: ret i1 undef
69 %this.addr = alloca ptr, align 8
70 store ptr %this, ptr %this.addr, align 8
71 %this1 = load ptr, ptr %this.addr, align 8
72 %call = call ptr @f5(ptr %this1)
76 define internal ptr @f5(ptr %this) align 2 {
77 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
78 ; CGSCC-LABEL: define {{[^@]+}}@f5
79 ; CGSCC-SAME: () #[[ATTR1:[0-9]+]] align 2 {
81 ; CGSCC-NEXT: ret ptr undef
84 %this.addr = alloca ptr, align 8
85 store ptr %this, ptr %this.addr, align 8
86 %this1 = load ptr, ptr %this.addr, align 8
90 ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
92 ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
93 ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
94 ; CGSCC: attributes #[[ATTR2]] = { nofree nosync willreturn }
96 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: