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
7 ; Inlining should nuke the invoke (and any inlined calls) here even with
8 ; argument promotion running along with it.
9 define void @zot() personality ptr @wibble {
10 ; TUNIT: Function Attrs: mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none)
11 ; TUNIT-LABEL: define {{[^@]+}}@zot
12 ; TUNIT-SAME: () #[[ATTR0:[0-9]+]] personality ptr @wibble {
14 ; TUNIT-NEXT: call void @hoge() #[[ATTR2:[0-9]+]]
15 ; TUNIT-NEXT: unreachable
17 ; TUNIT-NEXT: unreachable
19 ; TUNIT-NEXT: unreachable
21 ; CGSCC: Function Attrs: mustprogress nofree noreturn nosync nounwind willreturn memory(none)
22 ; CGSCC-LABEL: define {{[^@]+}}@zot
23 ; CGSCC-SAME: () #[[ATTR0:[0-9]+]] personality ptr @wibble {
25 ; CGSCC-NEXT: call void @hoge() #[[ATTR4:[0-9]+]]
26 ; CGSCC-NEXT: unreachable
28 ; CGSCC-NEXT: unreachable
30 ; CGSCC-NEXT: unreachable
34 to label %bb1 unwind label %bb2
40 %tmp = landingpad { ptr, i32 }
45 define internal void @hoge() {
46 ; TUNIT: Function Attrs: mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none)
47 ; TUNIT-LABEL: define {{[^@]+}}@hoge
48 ; TUNIT-SAME: () #[[ATTR0]] {
50 ; TUNIT-NEXT: unreachable
52 ; CGSCC: Function Attrs: mustprogress nofree noreturn nosync nounwind willreturn memory(none)
53 ; CGSCC-LABEL: define {{[^@]+}}@hoge
54 ; CGSCC-SAME: () #[[ATTR0]] {
56 ; CGSCC-NEXT: unreachable
59 %tmp = call fastcc ptr @spam(ptr @eggs)
60 %tmp1 = call fastcc ptr @spam(ptr @barney)
64 define internal fastcc ptr @spam(ptr %arg) {
65 ; CGSCC: Function Attrs: mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none)
66 ; CGSCC-LABEL: define {{[^@]+}}@spam
67 ; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
69 ; CGSCC-NEXT: unreachable
75 define internal i1 @eggs(ptr %arg) {
76 ; CGSCC-LABEL: define {{[^@]+}}@eggs
77 ; CGSCC-SAME: (ptr [[ARG:%.*]]) {
79 ; CGSCC-NEXT: [[TMP:%.*]] = call zeroext i1 @barney()
80 ; CGSCC-NEXT: unreachable
83 %tmp = call zeroext i1 @barney(ptr %arg)
87 define internal i1 @barney(ptr %arg) {
88 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
89 ; CGSCC-LABEL: define {{[^@]+}}@barney
90 ; CGSCC-SAME: () #[[ATTR2:[0-9]+]] {
92 ; CGSCC-NEXT: ret i1 undef
98 define i32 @test_inf_promote_caller(i32 %arg) {
99 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
100 ; TUNIT-LABEL: define {{[^@]+}}@test_inf_promote_caller
101 ; TUNIT-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] {
103 ; TUNIT-NEXT: ret i32 0
105 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
106 ; CGSCC-LABEL: define {{[^@]+}}@test_inf_promote_caller
107 ; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR3:[0-9]+]] {
109 ; CGSCC-NEXT: [[TMP:%.*]] = alloca [[S:%.*]], align 8
110 ; CGSCC-NEXT: [[TMP3:%.*]] = alloca i8, i32 0, align 8
111 ; CGSCC-NEXT: [[TMP1:%.*]] = alloca [[S]], align 8
112 ; CGSCC-NEXT: [[TMP14:%.*]] = alloca i8, i32 0, align 8
113 ; CGSCC-NEXT: ret i32 0
118 %tmp2 = call i32 @test_inf_promote_callee(ptr %tmp, ptr %tmp1)
123 define internal i32 @test_inf_promote_callee(ptr %arg, ptr %arg1) {
124 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
125 ; CGSCC-LABEL: define {{[^@]+}}@test_inf_promote_callee
126 ; CGSCC-SAME: () #[[ATTR3]] {
128 ; CGSCC-NEXT: ret i32 undef
131 %tmp2 = load ptr, ptr %arg1
132 %tmp4 = load ptr, ptr %arg
133 %tmp5 = call i32 @test_inf_promote_callee(ptr %tmp4, ptr %tmp2)
138 declare i32 @wibble(...)
140 ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) }
141 ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
142 ; TUNIT: attributes #[[ATTR2]] = { noreturn nounwind memory(none) }
144 ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noreturn nosync nounwind willreturn memory(none) }
145 ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) }
146 ; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
147 ; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
148 ; CGSCC: attributes #[[ATTR4]] = { noreturn nounwind memory(none) }
150 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: