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 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7 ; Test cases specifically designed for the "nofree" function attribute.
8 ; We use FIXME's to indicate problems and missing attributes.
11 declare void @free(ptr nocapture) local_unnamed_addr #1
12 declare noalias ptr @realloc(ptr nocapture, i64) local_unnamed_addr #0
13 declare void @_ZdaPv(ptr) local_unnamed_addr #2
16 ; TEST 1 (positive case)
17 define void @only_return() #0 {
18 ; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
19 ; CHECK-LABEL: define {{[^@]+}}@only_return
20 ; CHECK-SAME: () #[[ATTR3:[0-9]+]] {
21 ; CHECK-NEXT: ret void
27 ; TEST 2 (negative case)
29 ; void only_free(char* p) {
33 define void @only_free(ptr nocapture %0) local_unnamed_addr #0 {
34 ; CHECK: Function Attrs: noinline nounwind uwtable
35 ; CHECK-LABEL: define {{[^@]+}}@only_free
36 ; CHECK-SAME: (ptr nocapture [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] {
37 ; CHECK-NEXT: tail call void @free(ptr nocapture [[TMP0]]) #[[ATTR0:[0-9]+]]
38 ; CHECK-NEXT: ret void
40 tail call void @free(ptr %0) #1
45 ; TEST 3 (negative case)
46 ; Free occurs in same scc.
47 ; void free_in_scc1(char*p){
50 ; void free_in_scc2(char*p){
56 define void @free_in_scc1(ptr nocapture %0) local_unnamed_addr #0 {
57 ; CHECK: Function Attrs: noinline nounwind uwtable
58 ; CHECK-LABEL: define {{[^@]+}}@free_in_scc1
59 ; CHECK-SAME: (ptr nocapture [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
60 ; CHECK-NEXT: tail call void @free_in_scc2(ptr nocapture [[TMP0]]) #[[ATTR0]]
61 ; CHECK-NEXT: ret void
63 tail call void @free_in_scc2(ptr %0) #1
68 define void @free_in_scc2(ptr nocapture %0) local_unnamed_addr #0 {
69 ; CHECK: Function Attrs: noinline nounwind uwtable
70 ; CHECK-LABEL: define {{[^@]+}}@free_in_scc2
71 ; CHECK-SAME: (ptr nocapture [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
72 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[TMP0]], null
73 ; CHECK-NEXT: br i1 [[CMP]], label [[REC:%.*]], label [[CALL:%.*]]
75 ; CHECK-NEXT: tail call void @free(ptr nocapture nonnull [[TMP0]]) #[[ATTR0]]
76 ; CHECK-NEXT: br label [[END:%.*]]
78 ; CHECK-NEXT: tail call void @free_in_scc1(ptr nocapture [[TMP0]]) #[[ATTR0]]
79 ; CHECK-NEXT: br label [[END]]
81 ; CHECK-NEXT: ret void
83 %cmp = icmp eq ptr %0, null
84 br i1 %cmp, label %rec, label %call
86 tail call void @free(ptr %0) #1
89 tail call void @free_in_scc1(ptr %0)
96 ; TEST 4 (positive case)
98 ; void mutual_recursion1(){
99 ; mutual_recursion2();
101 ; void mutual_recursion2(){
102 ; mutual_recursion1();
106 define void @mutual_recursion1() #0 {
107 ; TUNIT: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable
108 ; TUNIT-LABEL: define {{[^@]+}}@mutual_recursion1
109 ; TUNIT-SAME: () #[[ATTR4:[0-9]+]] {
110 ; TUNIT-NEXT: ret void
112 ; CGSCC: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
113 ; CGSCC-LABEL: define {{[^@]+}}@mutual_recursion1
114 ; CGSCC-SAME: () #[[ATTR3]] {
115 ; CGSCC-NEXT: ret void
117 call void @mutual_recursion2()
121 define void @mutual_recursion2() #0 {
122 ; TUNIT: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable
123 ; TUNIT-LABEL: define {{[^@]+}}@mutual_recursion2
124 ; TUNIT-SAME: () #[[ATTR4]] {
125 ; TUNIT-NEXT: ret void
127 ; CGSCC: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
128 ; CGSCC-LABEL: define {{[^@]+}}@mutual_recursion2
129 ; CGSCC-SAME: () #[[ATTR3]] {
130 ; CGSCC-NEXT: ret void
132 call void @mutual_recursion1()
138 ; C++ delete operation (negative case)
139 ; void delete_op (char p[]){
143 define void @_Z9delete_opPc(ptr %0) local_unnamed_addr #0 {
144 ; CHECK: Function Attrs: noinline nounwind uwtable
145 ; CHECK-LABEL: define {{[^@]+}}@_Z9delete_opPc
146 ; CHECK-SAME: (ptr [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
147 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
148 ; CHECK-NEXT: br i1 [[TMP2]], label [[TMP4:%.*]], label [[TMP3:%.*]]
150 ; CHECK-NEXT: tail call void @_ZdaPv(ptr nonnull [[TMP0]]) #[[ATTR2:[0-9]+]]
151 ; CHECK-NEXT: br label [[TMP4]]
153 ; CHECK-NEXT: ret void
155 %2 = icmp eq ptr %0, null
156 br i1 %2, label %4, label %3
158 ; <label>:3: ; preds = %1
159 tail call void @_ZdaPv(ptr nonnull %0) #2
162 ; <label>:4: ; preds = %3, %1
167 ; TEST 6 (negative case)
169 define noalias ptr @call_realloc(ptr nocapture %0, i64 %1) local_unnamed_addr #0 {
170 ; CHECK: Function Attrs: noinline nounwind uwtable
171 ; CHECK-LABEL: define {{[^@]+}}@call_realloc
172 ; CHECK-SAME: (ptr nocapture [[TMP0:%.*]], i64 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR1]] {
173 ; CHECK-NEXT: [[RET:%.*]] = tail call ptr @realloc(ptr nocapture [[TMP0]], i64 [[TMP1]]) #[[ATTR2]]
174 ; CHECK-NEXT: ret ptr [[RET]]
176 %ret = tail call ptr @realloc(ptr %0, i64 %1) #2
181 ; TEST 7 (positive case)
182 ; Call function declaration with "nofree"
185 ; CHECK: Function Attrs: nofree noinline nounwind memory(none) uwtable
186 declare void @nofree_function() nofree readnone #0
188 define void @call_nofree_function() #0 {
189 ; TUNIT: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable
190 ; TUNIT-LABEL: define {{[^@]+}}@call_nofree_function
191 ; TUNIT-SAME: () #[[ATTR4]] {
192 ; TUNIT-NEXT: ret void
194 ; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable
195 ; CGSCC-LABEL: define {{[^@]+}}@call_nofree_function
196 ; CGSCC-SAME: () #[[ATTR5:[0-9]+]] {
197 ; CGSCC-NEXT: ret void
199 tail call void @nofree_function()
203 ; TEST 8 (negative case)
204 ; Call function declaration without "nofree"
207 ; CHECK: Function Attrs: noinline nounwind uwtable
208 declare void @maybe_free() #0
211 define void @call_maybe_free() #0 {
212 ; CHECK: Function Attrs: noinline nounwind uwtable
213 ; CHECK-LABEL: define {{[^@]+}}@call_maybe_free
214 ; CHECK-SAME: () #[[ATTR1]] {
215 ; CHECK-NEXT: tail call void @maybe_free() #[[ATTR0]]
216 ; CHECK-NEXT: ret void
218 tail call void @maybe_free()
223 ; TEST 9 (negative case)
224 ; Call both of above functions
226 define void @call_both() #0 {
227 ; CHECK: Function Attrs: noinline nounwind uwtable
228 ; CHECK-LABEL: define {{[^@]+}}@call_both
229 ; CHECK-SAME: () #[[ATTR1]] {
230 ; CHECK-NEXT: tail call void @maybe_free() #[[ATTR0]]
231 ; CHECK-NEXT: ret void
233 tail call void @maybe_free()
234 tail call void @nofree_function()
239 ; TEST 10 (positive case)
240 ; Call intrinsic function
241 ; CHECK: Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
242 declare float @llvm.floor.f32(float)
244 define void @call_floor(float %a) #0 {
245 ; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
246 ; CHECK-LABEL: define {{[^@]+}}@call_floor
247 ; CHECK-SAME: (float [[A:%.*]]) #[[ATTR3]] {
248 ; CHECK-NEXT: ret void
250 tail call float @llvm.floor.f32(float %a)
254 define float @call_floor2(float %a) #0 {
255 ; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
256 ; CHECK-LABEL: define {{[^@]+}}@call_floor2
257 ; CHECK-SAME: (float [[A:%.*]]) #[[ATTR3]] {
258 ; CHECK-NEXT: [[C:%.*]] = tail call nofpclass(sub) float @llvm.floor.f32(float [[A]]) #[[ATTR14:[0-9]+]]
259 ; CHECK-NEXT: ret float [[C]]
261 %c = tail call float @llvm.floor.f32(float %a)
265 ; TEST 11 (positive case)
268 define void @f1() #0 {
269 ; TUNIT: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable
270 ; TUNIT-LABEL: define {{[^@]+}}@f1
271 ; TUNIT-SAME: () #[[ATTR4]] {
272 ; TUNIT-NEXT: ret void
274 ; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable
275 ; CGSCC-LABEL: define {{[^@]+}}@f1
276 ; CGSCC-SAME: () #[[ATTR5]] {
277 ; CGSCC-NEXT: ret void
279 tail call void @nofree_function()
283 define void @f2() #0 {
284 ; TUNIT: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable
285 ; TUNIT-LABEL: define {{[^@]+}}@f2
286 ; TUNIT-SAME: () #[[ATTR4]] {
287 ; TUNIT-NEXT: ret void
289 ; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable
290 ; CGSCC-LABEL: define {{[^@]+}}@f2
291 ; CGSCC-SAME: () #[[ATTR5]] {
292 ; CGSCC-NEXT: ret void
298 ; TEST 12 NoFree argument - positive.
299 define double @test12(ptr nocapture readonly %a) {
300 ; CHECK: Function Attrs: nofree nounwind
301 ; CHECK-LABEL: define {{[^@]+}}@test12
302 ; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR7:[0-9]+]] {
304 ; CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[A]], align 8
305 ; CHECK-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR8:[0-9]+]]
306 ; CHECK-NEXT: ret double [[CALL]]
309 %0 = load double, ptr %a, align 8
310 %call = tail call double @cos(double %0) #2
314 declare double @cos(double) nobuiltin nounwind nofree
316 ; FIXME: %a should be nofree.
317 ; TEST 13 NoFree argument - positive.
318 define noalias ptr @test13(ptr nocapture readonly %a) {
319 ; CHECK: Function Attrs: nounwind
320 ; CHECK-LABEL: define {{[^@]+}}@test13
321 ; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR0]] {
323 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A]], align 8
324 ; CHECK-NEXT: [[CALL:%.*]] = tail call noalias ptr @malloc(i64 [[TMP0]]) #[[ATTR2]]
325 ; CHECK-NEXT: ret ptr [[CALL]]
328 %0 = load i64, ptr %a, align 8
329 %call = tail call noalias ptr @malloc(i64 %0) #2
333 define void @test14(ptr nocapture %0, ptr nocapture %1) {
334 ; CHECK: Function Attrs: nounwind
335 ; CHECK-LABEL: define {{[^@]+}}@test14
336 ; CHECK-SAME: (ptr nocapture [[TMP0:%.*]], ptr nocapture nofree readnone [[TMP1:%.*]]) #[[ATTR0]] {
337 ; CHECK-NEXT: tail call void @free(ptr nocapture [[TMP0]]) #[[ATTR0]]
338 ; CHECK-NEXT: ret void
340 tail call void @free(ptr %0) #1
346 define void @nonnull_assume_pos(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4) {
347 ; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_pos
348 ; ATTRIBUTOR-SAME: (ptr nofree [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr nofree [[ARG3:%.*]], ptr [[ARG4:%.*]])
349 ; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) #11 [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
350 ; ATTRIBUTOR-NEXT: call void @unknown(ptr nofree [[ARG1]], ptr [[ARG2]], ptr nofree [[ARG3]], ptr [[ARG4]])
351 ; ATTRIBUTOR-NEXT: ret void
353 ; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_pos
354 ; CHECK-SAME: (ptr nofree [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr nofree [[ARG3:%.*]], ptr [[ARG4:%.*]]) {
355 ; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR15:[0-9]+]] [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
356 ; CHECK-NEXT: call void @unknown(ptr nofree [[ARG1]], ptr [[ARG2]], ptr nofree [[ARG3]], ptr [[ARG4]])
357 ; CHECK-NEXT: ret void
359 call void @llvm.assume(i1 true) ["nofree"(ptr %arg1), "nofree"(ptr %arg3)]
360 call void @unknown(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4)
363 define void @nonnull_assume_neg(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4) {
364 ; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_neg
365 ; ATTRIBUTOR-SAME: (ptr [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr [[ARG3:%.*]], ptr [[ARG4:%.*]])
366 ; ATTRIBUTOR-NEXT: call void @unknown(ptr [[ARG1]], ptr [[ARG2]], ptr [[ARG3]], ptr [[ARG4]])
367 ; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
368 ; ATTRIBUTOR-NEXT: ret void
370 ; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_neg
371 ; CHECK-SAME: (ptr [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr [[ARG3:%.*]], ptr [[ARG4:%.*]]) {
372 ; CHECK-NEXT: call void @unknown(ptr [[ARG1]], ptr [[ARG2]], ptr [[ARG3]], ptr [[ARG4]])
373 ; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
374 ; CHECK-NEXT: ret void
376 call void @unknown(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4)
377 call void @llvm.assume(i1 true) ["nofree"(ptr %arg1), "nofree"(ptr %arg3)]
380 define void @nonnull_assume_call(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4) {
381 ; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_call
382 ; ATTRIBUTOR-SAME: (ptr [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr [[ARG3:%.*]], ptr [[ARG4:%.*]])
383 ; ATTRIBUTOR-NEXT: call void @unknown(ptr [[ARG1]], ptr [[ARG2]], ptr [[ARG3]], ptr [[ARG4]])
384 ; ATTRIBUTOR-NEXT: call void @use_i8_ptr(ptr noalias readnone [[ARG1]])
385 ; ATTRIBUTOR-NEXT: call void @use_i8_ptr(ptr noalias readnone [[ARG2]])
386 ; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
387 ; ATTRIBUTOR-NEXT: call void @use_i8_ptr(ptr noalias nofree readnone [[ARG3]])
388 ; ATTRIBUTOR-NEXT: call void @use_i8_ptr(ptr noalias readnone [[ARG4]])
389 ; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(ptr noalias nofree readnone [[ARG1]])
390 ; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(ptr noalias readnone [[ARG2]])
391 ; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG4]]) ]
392 ; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(ptr noalias nofree readnone [[ARG3]])
393 ; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(ptr noalias nofree readnone [[ARG4]])
394 ; ATTRIBUTOR-NEXT: ret void
396 ; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_call
397 ; CHECK-SAME: (ptr [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr [[ARG3:%.*]], ptr [[ARG4:%.*]]) {
398 ; CHECK-NEXT: call void @unknown(ptr [[ARG1]], ptr [[ARG2]], ptr [[ARG3]], ptr [[ARG4]])
399 ; CHECK-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[ARG1]]) #[[ATTR0]]
400 ; CHECK-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[ARG2]]) #[[ATTR0]]
401 ; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
402 ; CHECK-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[ARG3]]) #[[ATTR0]]
403 ; CHECK-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[ARG4]]) #[[ATTR0]]
404 ; CHECK-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree readnone [[ARG1]]) #[[ATTR0]]
405 ; CHECK-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree readnone [[ARG2]]) #[[ATTR0]]
406 ; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG4]]) ]
407 ; CHECK-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree readnone [[ARG3]]) #[[ATTR0]]
408 ; CHECK-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree readnone [[ARG4]]) #[[ATTR0]]
409 ; CHECK-NEXT: ret void
411 call void @unknown(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4)
412 call void @use_i8_ptr(ptr %arg1)
413 call void @use_i8_ptr(ptr %arg2)
414 call void @llvm.assume(i1 true) ["nofree"(ptr %arg1), "nofree"(ptr %arg3)]
415 call void @use_i8_ptr(ptr %arg3)
416 call void @use_i8_ptr(ptr %arg4)
417 call void @use_i8_ptr_ret(ptr %arg1)
418 call void @use_i8_ptr_ret(ptr %arg2)
419 call void @llvm.assume(i1 true) ["nofree"(ptr %arg1), "nofree"(ptr %arg4)]
420 call void @use_i8_ptr_ret(ptr %arg3)
421 call void @use_i8_ptr_ret(ptr %arg4)
425 ; FIXME: function is nofree
426 define weak void @implied_nofree1() readnone {
427 ; CHECK: Function Attrs: nosync memory(none)
428 ; CHECK-LABEL: define {{[^@]+}}@implied_nofree1
429 ; CHECK-SAME: () #[[ATTR9:[0-9]+]] {
430 ; CHECK-NEXT: ret void
434 ; FIXME: function is nofree
435 define weak void @implied_nofree2() readonly {
436 ; CHECK: Function Attrs: nosync memory(read)
437 ; CHECK-LABEL: define {{[^@]+}}@implied_nofree2
438 ; CHECK-SAME: () #[[ATTR10:[0-9]+]] {
439 ; CHECK-NEXT: ret void
443 define weak void @implied_nofree3(ptr readnone %a) {
444 ; CHECK-LABEL: define {{[^@]+}}@implied_nofree3
445 ; CHECK-SAME: (ptr nofree readnone [[A:%.*]]) {
446 ; CHECK-NEXT: ret void
450 define weak void @implied_nofree4(ptr readonly %a) {
451 ; CHECK-LABEL: define {{[^@]+}}@implied_nofree4
452 ; CHECK-SAME: (ptr nofree readonly [[A:%.*]]) {
453 ; CHECK-NEXT: ret void
457 ; FIXME: %a is nofree
458 define weak void @implied_nofree5(ptr %a) readonly {
459 ; CHECK: Function Attrs: nosync memory(read)
460 ; CHECK-LABEL: define {{[^@]+}}@implied_nofree5
461 ; CHECK-SAME: (ptr [[A:%.*]]) #[[ATTR10]] {
462 ; CHECK-NEXT: ret void
466 define weak void @implied_nofree6(ptr %a) nofree {
467 ; CHECK: Function Attrs: nofree
468 ; CHECK-LABEL: define {{[^@]+}}@implied_nofree6
469 ; CHECK-SAME: (ptr nofree [[A:%.*]]) #[[ATTR11:[0-9]+]] {
470 ; CHECK-NEXT: ret void
475 declare void @llvm.assume(i1)
476 declare void @unknown(ptr, ptr, ptr, ptr)
477 declare void @use_i8_ptr(ptr nocapture readnone) nounwind
478 declare void @use_i8_ptr_ret(ptr nocapture readnone) nounwind willreturn
480 declare noalias ptr @malloc(i64)
482 attributes #0 = { nounwind uwtable noinline }
483 attributes #1 = { nounwind }
484 attributes #2 = { nobuiltin nounwind }
486 ; TUNIT: attributes #[[ATTR0]] = { nounwind }
487 ; TUNIT: attributes #[[ATTR1]] = { noinline nounwind uwtable }
488 ; TUNIT: attributes #[[ATTR2]] = { nobuiltin nounwind }
489 ; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable }
490 ; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable }
491 ; TUNIT: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind memory(none) uwtable }
492 ; TUNIT: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
493 ; TUNIT: attributes #[[ATTR7]] = { nofree nounwind }
494 ; TUNIT: attributes #[[ATTR8]] = { nobuiltin nofree nounwind }
495 ; TUNIT: attributes #[[ATTR9]] = { nosync memory(none) }
496 ; TUNIT: attributes #[[ATTR10]] = { nosync memory(read) }
497 ; TUNIT: attributes #[[ATTR11]] = { nofree }
498 ; TUNIT: attributes #[[ATTR12:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
499 ; TUNIT: attributes #[[ATTR13:[0-9]+]] = { nounwind willreturn }
500 ; TUNIT: attributes #[[ATTR14]] = { nofree nosync willreturn }
501 ; TUNIT: attributes #[[ATTR15]] = { nofree willreturn memory(write) }
503 ; CGSCC: attributes #[[ATTR0]] = { nounwind }
504 ; CGSCC: attributes #[[ATTR1]] = { noinline nounwind uwtable }
505 ; CGSCC: attributes #[[ATTR2]] = { nobuiltin nounwind }
506 ; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable }
507 ; CGSCC: attributes #[[ATTR4:[0-9]+]] = { nofree noinline nounwind memory(none) uwtable }
508 ; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable }
509 ; CGSCC: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
510 ; CGSCC: attributes #[[ATTR7]] = { nofree nounwind }
511 ; CGSCC: attributes #[[ATTR8]] = { nobuiltin nofree nounwind }
512 ; CGSCC: attributes #[[ATTR9]] = { nosync memory(none) }
513 ; CGSCC: attributes #[[ATTR10]] = { nosync memory(read) }
514 ; CGSCC: attributes #[[ATTR11]] = { nofree }
515 ; CGSCC: attributes #[[ATTR12:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
516 ; CGSCC: attributes #[[ATTR13:[0-9]+]] = { nounwind willreturn }
517 ; CGSCC: attributes #[[ATTR14]] = { nofree nosync willreturn }
518 ; CGSCC: attributes #[[ATTR15]] = { nofree willreturn memory(write) }