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-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
7 define internal i32 @callee(i1 %C, ptr %P) {
8 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
9 ; CGSCC-LABEL: define {{[^@]+}}@callee
10 ; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
11 ; CGSCC-NEXT: [[P_PRIV:%.*]] = alloca i32, align 4
12 ; CGSCC-NEXT: store i32 [[TMP0]], ptr [[P_PRIV]], align 4
13 ; CGSCC-NEXT: br label [[F:%.*]]
15 ; CGSCC-NEXT: unreachable
17 ; CGSCC-NEXT: [[X:%.*]] = load i32, ptr [[P_PRIV]], align 4
18 ; CGSCC-NEXT: ret i32 [[X]]
20 br i1 %C, label %T, label %F
26 %X = load i32, ptr %P ; <i32> [#uses=1]
31 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
32 ; TUNIT-LABEL: define {{[^@]+}}@foo
33 ; TUNIT-SAME: () #[[ATTR0:[0-9]+]] {
34 ; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4
35 ; TUNIT-NEXT: ret i32 17
37 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
38 ; CGSCC-LABEL: define {{[^@]+}}@foo
39 ; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
40 ; CGSCC-NEXT: [[X:%.*]] = call i32 @callee(i32 noundef 17) #[[ATTR2:[0-9]+]]
41 ; CGSCC-NEXT: ret i32 [[X]]
43 %A = alloca i32 ; <ptr> [#uses=2]
45 %X = call i32 @callee( i1 false, ptr %A ) ; <i32> [#uses=1]
50 ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
52 ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
53 ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
54 ; CGSCC: attributes #[[ATTR2]] = { nofree nosync willreturn }
56 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: