brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · ebeb24d Raw
58 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals2; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal  -attributor-annotate-decl-cs  -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT3; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC4 5target 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"6 7define internal i32 @callee(i1 %C, ptr %P) {8; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)9; CGSCC-LABEL: define {{[^@]+}}@callee10; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {11; CGSCC-NEXT:    [[P_PRIV:%.*]] = alloca i32, align 412; CGSCC-NEXT:    store i32 [[TMP0]], ptr [[P_PRIV]], align 413; CGSCC-NEXT:    br label [[F:%.*]]14; CGSCC:       T:15; CGSCC-NEXT:    unreachable16; CGSCC:       F:17; CGSCC-NEXT:    [[X:%.*]] = load i32, ptr [[P_PRIV]], align 418; CGSCC-NEXT:    ret i32 [[X]]19;20  br i1 %C, label %T, label %F21 22T:              ; preds = %023  ret i32 1724 25F:              ; preds = %026  %X = load i32, ptr %P               ; <i32> [#uses=1]27  ret i32 %X28}29 30define i32 @foo() {31; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)32; TUNIT-LABEL: define {{[^@]+}}@foo33; TUNIT-SAME: () #[[ATTR0:[0-9]+]] {34; TUNIT-NEXT:    [[A:%.*]] = alloca i32, align 435; TUNIT-NEXT:    ret i32 1736;37; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)38; CGSCC-LABEL: define {{[^@]+}}@foo39; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {40; CGSCC-NEXT:    [[X:%.*]] = call i32 @callee(i32 noundef 17) #[[ATTR2:[0-9]+]]41; CGSCC-NEXT:    ret i32 [[X]]42;43  %A = alloca i32         ; <ptr> [#uses=2]44  store i32 17, ptr %A45  %X = call i32 @callee( i1 false, ptr %A )              ; <i32> [#uses=1]46  ret i32 %X47}48 49;.50; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }51;.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 }55;.56;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:57; CHECK: {{.*}}58