Home
last modified time | relevance | path

Searched refs:strncpy (Results 1 – 25 of 91) sorted by relevance

1234

/llvm-project-15.0.7/llvm/test/Transforms/InstCombine/
H A Dstrncpy-1.ll2 ; Test that the strncpy library call simplifier works correctly.
14 declare i8* @strncpy(i8*, i8*, i32)
17 ; Check a bunch of strncpy invocations together.
47 ; Check strncpy(x, "", y) -> memset(x, '\0', y, 1).
57 call i8* @strncpy(i8* %dst, i8* %src, i32 32)
61 ; Check strncpy(x, y, 0) -> x.
70 %ret = call i8* @strncpy(i8* %dst, i8* %src, i32 0)
84 call i8* @strncpy(i8* %dst, i8* %src, i32 6)
167 call i8* @strncpy(i8* %dst, i8* %src, i32 32)
179 call i8* @strncpy(i8* %dst, i8* %src, i32 8)
[all …]
H A Dstrncpy-3.ll9 declare i8* @strncpy(i8*, i8*, i64)
18 …tail call i8* @strncpy(i8* %dst, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 …
28 …tail call i8* @strncpy(i8* %dst, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str2, i64 0, i64…
38 …tail call i8* @strncpy(i8* %dst, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str3, i64 0, i64…
47 …tail call i8* @strncpy(i8* %dst, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str3, i64 0, i64…
53 ; CHECK-NEXT: [[TMP1:%.*]] = tail call i8* @strncpy(i8* noundef nonnull dereferenceable(1) [[DST…
56 …tail call i8* @strncpy(i8* %dst, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str3, i64 0, i64…
H A Dstrncpy-2.ll2 ; Test that the strncpy library call simplifier works correctly.
11 declare i16* @strncpy(i8*, i8*, i32)
13 ; Check that 'strncpy' functions with the wrong prototype aren't simplified.
17 ; CHECK-NEXT: [[TMP1:%.*]] = call i16* @strncpy(i8* getelementptr inbounds ([32 x i8], [32 x i8]…
23 call i16* @strncpy(i8* %dst, i8* %src, i32 6)
H A Dstrncmp-wrong-datalayout.ll1 ; Test that the strncpy simplification doesn't crash if datalayout specifies
/llvm-project-15.0.7/compiler-rt/lib/asan/tests/
H A Dasan_str_test.cpp218 strncpy(to, from, 0); in TEST()
219 strncpy(to - 1, from - 1, 0); in TEST()
221 strncpy(to, from, from_size); in TEST()
222 strncpy(to, from, to_size); in TEST()
223 strncpy(to, from + from_size - 1, to_size); in TEST()
224 strncpy(to + to_size - 1, from, 1); in TEST()
232 EXPECT_DEATH(Ident(strncpy(to + to_size, from, 1)), in TEST()
242 strncpy(to, from, from_size); in TEST()
244 EXPECT_DEATH(Ident(strncpy(to, from, to_size)), in TEST()
520 strncpy(str, str + 10, 10); in TEST()
[all …]
/llvm-project-15.0.7/llvm/test/Transforms/DeadStoreElimination/
H A Dlibcalls.ll38 declare i8* @strncpy(i8* %dest, i8* %src, i64 %n) nounwind
45 %call = call i8* @strncpy(i8* %dest, i8* %src, i64 12)
455 ; strncpy -> memset, full overwrite
468 ; strncpy -> __memset_chk, full overwrite
537 ; strncpy -> memset, partial overwrite
549 ; strncpy -> memset_chk, partial overwrite
561 ; strncpy -> memset, different destination
573 ; strncpy -> memset_chk, different destination
585 ; memset -> strncpy, full overwrite
596 ; memset -> strncpy, partial overwrite
[all …]
/llvm-project-15.0.7/clang/test/Analysis/
H A Dstring.c533 #define strncpy BUILTIN(strncpy) macro
564 strncpy(p, "AAA", sizeof("AAA")); in cstringchecker_bounds_nocrash()
572 strncpy(x, y, 5); in strncpy_overflow()
582 strncpy(x, y, 5); in strncpy_no_overflow()
595 strncpy(x, y, n); in strncpy_no_overflow2()
603 strncpy(x, y, 3); // no-warning in strncpy_truncate()
609 strncpy(x, y, 3); // no-warning in strncpy_no_truncate()
614 strncpy(x, y, 4); // no-warning in strncpy_exactly_matching_buffer()
623 strncpy(dst, src, 0); // no-warning in strncpy_zero()
629 strncpy(dst, src, 4); // no-warning in strncpy_empty()
[all …]
H A Dcstring-plist.c13 char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
19 strncpy(p, "AAA", sizeof("AAA")); // we don't expect warning as the checker is disabled in cstringchecker_bounds_nocrash()
/llvm-project-15.0.7/llvm/test/Analysis/BasicAA/
H A Dlibfuncs.ll227 declare i8* @strncpy(i8*, i8*, i64)
231 ; CHECK: Just Mod: Ptr: i8* %a <-> %res = tail call i8* @strncpy(i8* %a, i8* %b, i64 4)
232 ; CHECK-NEXT: Just Ref: Ptr: i8* %b <-> %res = tail call i8* @strncpy(i8* %a, i8* %b, i64 4)
233 ; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call i8* @strncpy(i8* %a, i8* %b, i64 4)
234 ; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = tail call i8* @strncpy(i8* %a, i8* %b, i64 …
235 ; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.5 <-> %res = tail call i8* @strncpy(i8* %a, i8* %b, i64 …
242 %res = tail call i8* @strncpy(i8* %a, i8* %b, i64 4)
257 ; CHECK: Just Mod: Ptr: i8* %a <-> %res = tail call i8* @strncpy(i8* %a, i8* %b, i64 %n)
258 ; CHECK-NEXT: Just Ref: Ptr: i8* %b <-> %res = tail call i8* @strncpy(i8* %a, i8* %b, i64 %n)
259 ; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call i8* @strncpy(i8* %a, i8* %b, i64 %n)
[all …]
/llvm-project-15.0.7/openmp/runtime/src/
H A Dkmp_safe_c_api.h63 #define KMP_STRNCPY_S(dst, bsz, src, cnt) strncpy(dst, src, cnt)
65 #define KMP_STRNCPY strncpy
/llvm-project-15.0.7/clang/test/SemaCXX/
H A Dwarn-memsize-comparison.cpp11 extern "C" char *strncpy(char *dst, const char *src, size_t n);
56 if (strncpy(b1, b2, sizeof(b1) == 0 || true)) {} // \ in f()
60 if (strncpy(b1, b2, sizeof(b1)) == 0 || true) {} in f()
H A Dwarn-memset-bad-sizeof.cpp171 extern "C" char *strncpy(char *det, const char *src, unsigned n);
186 strncpy(buff, BAR, sizeof(BAR)); // \ in strcpy_and_friends()
/llvm-project-15.0.7/compiler-rt/lib/memprof/
H A Dmemprof_interceptors.cpp265 INTERCEPTOR(char *, strncpy, char *to, const char *from, uptr size) { in INTERCEPTOR() argument
267 MEMPROF_INTERCEPTOR_ENTER(ctx, strncpy); in INTERCEPTOR()
272 return REAL(strncpy)(to, from, size); in INTERCEPTOR()
344 MEMPROF_INTERCEPT_FUNC(strncpy); in InitializeMemprofInterceptors()
H A Dmemprof_interceptors.h39 DECLARE_REAL(char *, strncpy, char *to, const char *from, uptr size)
/llvm-project-15.0.7/clang/test/CodeGen/
H A Dlibcalls-fno-builtin.c31 char *strncpy(char *s1, const char *s2, size_t n);
105 char *t14(char *x) { return strncpy(x, "foo", 3); } in t14()
/llvm-project-15.0.7/libc/src/string/
H A Dstrncpy.h16 char *strncpy(char *__restrict dest, const char *__restrict src, size_t n);
H A Dstrncpy.cpp16 LLVM_LIBC_FUNCTION(char *, strncpy,
H A Dstrncat.cpp23 __llvm_libc::strncpy(dest + dest_length, src, copy_amount);
H A DCMakeLists.txt170 .strncpy
183 strncpy
185 strncpy.cpp
187 strncpy.h
/llvm-project-15.0.7/compiler-rt/test/asan/TestCases/
H A Dstrncpy-overlap.cpp42 strncpy(buffer, buffer + 1, 5); // BOOM in bad_function()
H A Dstrncpy-overflow.cpp29 strncpy(short_buffer, hello, 10); // BOOM in main()
/llvm-project-15.0.7/libcxx/include/
H A Dcstring30 char* strncpy(char* restrict s1, const char* restrict s2, size_t n);
73 using ::strncpy _LIBCPP_USING_IF_EXISTS;
/llvm-project-15.0.7/clang-tools-extra/test/clang-tidy/checkers/bugprone/
H A Dnot-null-terminated-result-memcpy-before-safe.c69 strncpy(dst21, src, strlen(src) - 1); in good_memcpy_partial_source_length()
/llvm-project-15.0.7/compiler-rt/lib/asan/
H A Dasan_interceptors.cpp477 INTERCEPTOR(char*, strncpy, char *to, const char *from, uptr size) { in INTERCEPTOR() argument
479 ASAN_INTERCEPTOR_ENTER(ctx, strncpy); in INTERCEPTOR()
487 return REAL(strncpy)(to, from, size); in INTERCEPTOR()
641 ASAN_INTERCEPT_FUNC(strncpy); in InitializeAsanInterceptors()
/llvm-project-15.0.7/llvm/test/Other/
H A Dcgscc-libcall-update.ll21 ; CHECK: call i8* @strncpy(i8* noundef nonnull dereferenceable(1) %arg2, i8* noundef nonnul…
29 define i8* @strncpy(i8* %arg1, i8* %arg2, i64 %size) noinline {

1234