brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.7 KiB · 516b80b Raw
103 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 7%struct.ss = type { i32, i64 }8 9define internal i32 @f(ptr byval(%struct.ss)  %b) nounwind  {10; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)11; CHECK-LABEL: define {{[^@]+}}@f12; CHECK-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] {13; CHECK-NEXT:  entry:14; CHECK-NEXT:    [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 415; 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:    ret i32 [[VAL1]]22;23entry:24  %val1 = load i32, ptr %b, align 425  %val2 = add i32 %val1, 126  store i32 %val2, ptr %b, align 427  ret i32 %val128}29 30 31define internal i32 @g(ptr byval(%struct.ss) align 32 %b) nounwind {32; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)33; CHECK-LABEL: define {{[^@]+}}@g34; CHECK-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] {35; CHECK-NEXT:  entry:36; CHECK-NEXT:    [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 437; CHECK-NEXT:    store i32 [[TMP0]], ptr [[B_PRIV]], align 438; CHECK-NEXT:    [[B_PRIV_B4:%.*]] = getelementptr i8, ptr [[B_PRIV]], i64 439; CHECK-NEXT:    store i64 [[TMP1]], ptr [[B_PRIV_B4]], align 440; CHECK-NEXT:    [[VAL1:%.*]] = load i32, ptr [[B_PRIV]], align 3241; CHECK-NEXT:    [[VAL2:%.*]] = add i32 [[VAL1]], 142; CHECK-NEXT:    store i32 [[VAL2]], ptr [[B_PRIV]], align 3243; CHECK-NEXT:    ret i32 [[VAL2]]44;45entry:46  %val1 = load i32, ptr %b, align 447  %val2 = add i32 %val1, 148  store i32 %val2, ptr %b, align 449  ret i32 %val250}51 52 53define i32 @main() nounwind  {54; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)55; TUNIT-LABEL: define {{[^@]+}}@main56; TUNIT-SAME: () #[[ATTR0]] {57; TUNIT-NEXT:  entry:58; TUNIT-NEXT:    [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 459; TUNIT-NEXT:    store i32 1, ptr [[S]], align 3260; TUNIT-NEXT:    [[VAL4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 161; TUNIT-NEXT:    [[TMP0:%.*]] = load i32, ptr [[S]], align 862; TUNIT-NEXT:    [[S_B4:%.*]] = getelementptr i8, ptr [[S]], i64 463; TUNIT-NEXT:    [[TMP1:%.*]] = load i64, ptr [[S_B4]], align 864; TUNIT-NEXT:    [[C0:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR1:[0-9]+]]65; TUNIT-NEXT:    [[TMP2:%.*]] = load i32, ptr [[S]], align 3266; TUNIT-NEXT:    [[S_B41:%.*]] = getelementptr i8, ptr [[S]], i64 467; TUNIT-NEXT:    [[TMP3:%.*]] = load i64, ptr [[S_B41]], align 3268; TUNIT-NEXT:    [[C1:%.*]] = call i32 @g(i32 [[TMP2]], i64 [[TMP3]]) #[[ATTR1]]69; TUNIT-NEXT:    [[A:%.*]] = add i32 [[C0]], [[C1]]70; TUNIT-NEXT:    ret i32 [[A]]71;72; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)73; CGSCC-LABEL: define {{[^@]+}}@main74; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {75; CGSCC-NEXT:  entry:76; CGSCC-NEXT:    [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 477; CGSCC-NEXT:    [[VAL4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 178; CGSCC-NEXT:    [[C0:%.*]] = call i32 @f(i32 noundef 1, i64 noundef 2) #[[ATTR2:[0-9]+]]79; CGSCC-NEXT:    [[C1:%.*]] = call i32 @g(i32 noundef 1, i64 noundef 2) #[[ATTR2]]80; CGSCC-NEXT:    [[A:%.*]] = add i32 [[C0]], [[C1]]81; CGSCC-NEXT:    ret i32 [[A]]82;83entry:84  %S = alloca %struct.ss85  store i32 1, ptr %S, align 886  %val4 = getelementptr %struct.ss, ptr %S, i32 0, i32 187  store i64 2, ptr %val4, align 488  %c0 = call i32 @f(ptr byval(%struct.ss) %S) nounwind89  %c1 = call i32 @g(ptr byval(%struct.ss) %S) nounwind90  %a = add i32 %c0, %c191  ret i32 %a92}93 94 95;.96; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }97; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn }98;.99; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }100; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }101; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn }102;.103