xref: /llvm-project/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll (revision 29441e4f5fa5f5c7709f7cf180815ba97f611297)
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
4
5define internal fastcc i32 @term_SharingList(ptr %Term, ptr %List) nounwind {
6; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
7; CGSCC-LABEL: define {{[^@]+}}@term_SharingList
8; CGSCC-SAME: () #[[ATTR0:[0-9]+]] {
9; CGSCC-NEXT:  entry:
10; CGSCC-NEXT:    br i1 false, label [[BB:%.*]], label [[BB5:%.*]]
11; CGSCC:       bb:
12; CGSCC-NEXT:    unreachable
13; CGSCC:       bb5:
14; CGSCC-NEXT:    ret i32 undef
15;
16entry:
17  br i1 false, label %bb, label %bb5
18
19bb:		; preds = %entry
20  %0 = call fastcc i32 @term_SharingList( ptr null, ptr %List ) nounwind		; <i32> [#uses=0]
21  unreachable
22
23bb5:		; preds = %entry
24  ret i32 0
25}
26
27define i32 @term_Sharing(ptr %Term) nounwind {
28; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
29; CHECK-LABEL: define {{[^@]+}}@term_Sharing
30; CHECK-SAME: (ptr nofree readnone captures(none) [[TERM:%.*]]) #[[ATTR0:[0-9]+]] {
31; CHECK-NEXT:  entry:
32; CHECK-NEXT:    br i1 false, label [[BB_I:%.*]], label [[BB14:%.*]]
33; CHECK:       bb.i:
34; CHECK-NEXT:    unreachable
35; CHECK:       bb14:
36; CHECK-NEXT:    ret i32 0
37;
38entry:
39  br i1 false, label %bb.i, label %bb14
40
41bb.i:		; preds = %entry
42  %0 = call fastcc i32 @term_SharingList( ptr null, ptr null ) nounwind		; <i32> [#uses=0]
43  ret i32 1
44
45bb14:		; preds = %entry
46  ret i32 0
47}
48;.
49; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
50;.
51; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
52;.
53;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
54; TUNIT: {{.*}}
55