brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 36dbe19 Raw
66 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals2; RUN: opt < %s -passes=instcombine -S | FileCheck %s3 4 5@str = constant [2 x i8] c"a\00"6@str2 = constant [3 x i8] c"abc"7@str3 = constant [4 x i8] c"abcd"8 9declare ptr @strncpy(ptr, ptr, i64)10 11 12;.13; CHECK: @str = constant [2 x i8] c"a\00"14; CHECK: @str2 = constant [3 x i8] c"abc"15; CHECK: @str3 = constant [4 x i8] c"abcd"16; CHECK: @str.1 = private unnamed_addr constant [4 x i8] c"a\00\00\00", align 117; CHECK: @str.2 = private unnamed_addr constant [128 x i8] c"abcd\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", align 118;.19define void @fill_with_zeros(ptr %dst) {20; CHECK-LABEL: @fill_with_zeros(21; CHECK-NEXT:    store i32 97, ptr [[DST:%.*]], align 122; CHECK-NEXT:    ret void23;24  tail call ptr @strncpy(ptr %dst, ptr @str, i64 4)25  ret void26}27 28define void @fill_with_zeros2(ptr %dst) {29; CHECK-LABEL: @fill_with_zeros2(30; CHECK-NEXT:    store i32 6513249, ptr [[DST:%.*]], align 131; CHECK-NEXT:    ret void32;33  tail call ptr @strncpy(ptr %dst, ptr @str2, i64 4)34  ret void35}36 37define void @fill_with_zeros3(ptr %dst) {38; CHECK-LABEL: @fill_with_zeros3(39; CHECK-NEXT:    store i32 1684234849, ptr [[DST:%.*]], align 140; CHECK-NEXT:    ret void41;42  tail call ptr @strncpy(ptr %dst, ptr @str3, i64 4)43  ret void44}45 46define void @fill_with_zeros4(ptr %dst) {47; CHECK-LABEL: @fill_with_zeros4(48; CHECK-NEXT:    tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(128) [[DST:%.*]], ptr noundef nonnull align 1 dereferenceable(128) @str.2, i64 128, i1 false)49; CHECK-NEXT:    ret void50;51  tail call ptr @strncpy(ptr %dst, ptr @str3, i64 128)52  ret void53}54 55define void @no_simplify(ptr %dst) {56; CHECK-LABEL: @no_simplify(57; CHECK-NEXT:    [[TMP1:%.*]] = tail call ptr @strncpy(ptr noundef nonnull dereferenceable(1) [[DST:%.*]], ptr noundef nonnull dereferenceable(5) @str3, i64 129)58; CHECK-NEXT:    ret void59;60  tail call ptr @strncpy(ptr %dst, ptr @str3, i64 129)61  ret void62}63;.64; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }65;.66