brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · 21dedc7 Raw
67 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,CGSCC4target 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"5 6define internal i32 @test(ptr %X, ptr %Y) {7; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)8; CGSCC-LABEL: define {{[^@]+}}@test9; CGSCC-SAME: (i32 [[TMP0:%.*]], ptr nofree noundef nonnull readonly align 4 captures(none) dereferenceable(4) [[Y:%.*]]) #[[ATTR0:[0-9]+]] {10; CGSCC-NEXT:    [[X_PRIV:%.*]] = alloca i32, align 411; CGSCC-NEXT:    store i32 [[TMP0]], ptr [[X_PRIV]], align 412; CGSCC-NEXT:    [[A:%.*]] = load i32, ptr [[X_PRIV]], align 413; CGSCC-NEXT:    [[B:%.*]] = load i32, ptr [[Y]], align 414; CGSCC-NEXT:    [[C:%.*]] = add i32 [[A]], [[B]]15; CGSCC-NEXT:    ret i32 [[C]]16;17  %A = load i32, ptr %X18  %B = load i32, ptr %Y19  %C = add i32 %A, %B20  ret i32 %C21}22 23define internal i32 @caller(ptr %B) {24; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)25; CGSCC-LABEL: define {{[^@]+}}@caller26; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] {27; CGSCC-NEXT:    [[B_PRIV:%.*]] = alloca i32, align 428; CGSCC-NEXT:    store i32 [[TMP0]], ptr [[B_PRIV]], align 429; CGSCC-NEXT:    [[C:%.*]] = call i32 @test(i32 noundef 1, ptr noalias nofree noundef nonnull readonly align 4 captures(none) dereferenceable(4) [[B_PRIV]]) #[[ATTR2:[0-9]+]]30; CGSCC-NEXT:    ret i32 [[C]]31;32  %A = alloca i3233  store i32 1, ptr %A34  %C = call i32 @test(ptr %A, ptr %B)35  ret i32 %C36}37 38define i32 @callercaller() {39; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)40; TUNIT-LABEL: define {{[^@]+}}@callercaller41; TUNIT-SAME: () #[[ATTR0:[0-9]+]] {42; TUNIT-NEXT:    [[B:%.*]] = alloca i32, align 443; TUNIT-NEXT:    ret i32 344;45; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)46; CGSCC-LABEL: define {{[^@]+}}@callercaller47; CGSCC-SAME: () #[[ATTR1]] {48; CGSCC-NEXT:    [[X:%.*]] = call i32 @caller(i32 noundef 2) #[[ATTR3:[0-9]+]]49; CGSCC-NEXT:    ret i32 [[X]]50;51  %B = alloca i3252  store i32 2, ptr %B53  %X = call i32 @caller(ptr %B)54  ret i32 %X55}56 57;.58; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }59;.60; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }61; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }62; CGSCC: attributes #[[ATTR2]] = { nofree willreturn memory(read) }63; CGSCC: attributes #[[ATTR3]] = { nofree nosync willreturn }64;.65;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:66; CHECK: {{.*}}67