brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.6 KiB · 82626e5 Raw
73 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 5%struct.ss = type { i32, i64 }6 7define internal void @f(ptr byval(%struct.ss)  %b, ptr byval(i32) %X) nounwind  {8; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)9; CHECK-LABEL: define {{[^@]+}}@f10; CHECK-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] {11; CHECK-NEXT:  entry:12; CHECK-NEXT:    [[X_PRIV:%.*]] = alloca i32, align 413; CHECK-NEXT:    store i32 [[TMP2]], ptr [[X_PRIV]], align 414; CHECK-NEXT:    [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 815; CHECK-NEXT:    store i32 [[TMP0]], ptr [[B_PRIV]], align 416; CHECK-NEXT:    [[B_PRIV_B4:%.*]] = getelementptr i8, ptr [[B_PRIV]], i64 417; CHECK-NEXT:    store i64 [[TMP1]], ptr [[B_PRIV_B4]], align 418; CHECK-NEXT:    [[VAL1:%.*]] = load i32, ptr [[B_PRIV]], align 819; CHECK-NEXT:    [[VAL2:%.*]] = add i32 [[VAL1]], 120; CHECK-NEXT:    store i32 [[VAL2]], ptr [[B_PRIV]], align 821; CHECK-NEXT:    store i32 0, ptr [[X_PRIV]], align 422; CHECK-NEXT:    ret void23;24entry:25  %val1 = load i32, ptr %b, align 426  %val2 = add i32 %val1, 127  store i32 %val2, ptr %b, align 428 29  store i32 0, ptr %X30  ret void31}32 33define i32 @test(ptr %X) {34;35; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)36; TUNIT-LABEL: define {{[^@]+}}@test37; TUNIT-SAME: (ptr nofree nonnull readonly captures(none) [[X:%.*]]) #[[ATTR1:[0-9]+]] {38; TUNIT-NEXT:  entry:39; TUNIT-NEXT:    [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 840; TUNIT-NEXT:    store i32 1, ptr [[S]], align 841; TUNIT-NEXT:    [[VAL4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 142; TUNIT-NEXT:    [[TMP0:%.*]] = load i32, ptr [[S]], align 843; TUNIT-NEXT:    [[S_B4:%.*]] = getelementptr i8, ptr [[S]], i64 444; TUNIT-NEXT:    [[TMP1:%.*]] = load i64, ptr [[S_B4]], align 845; TUNIT-NEXT:    [[TMP2:%.*]] = load i32, ptr [[X]], align 446; TUNIT-NEXT:    call void @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR2:[0-9]+]]47; TUNIT-NEXT:    ret i32 048;49; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite)50; CGSCC-LABEL: define {{[^@]+}}@test51; CGSCC-SAME: (ptr nofree noundef nonnull readonly align 4 captures(none) dereferenceable(4) [[X:%.*]]) #[[ATTR1:[0-9]+]] {52; CGSCC-NEXT:  entry:53; CGSCC-NEXT:    [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 854; CGSCC-NEXT:    [[VAL4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 155; CGSCC-NEXT:    ret i32 056;57entry:58  %S = alloca %struct.ss59  store i32 1, ptr %S, align 860  %val4 = getelementptr %struct.ss, ptr %S, i32 0, i32 161  store i64 2, ptr %val4, align 462  call void @f(ptr byval(%struct.ss) %S, ptr byval(i32) %X)63  ret i32 064}65;.66; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }67; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }68; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn }69;.70; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }71; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) }72;.73