[compiler-rt] [NFC][sanitizer] Add test for length sub-specifier "z" (PR #128448)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 23 17:19:50 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: Vitaly Buka (vitalybuka)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/128448.diff
1 Files Affected:
- (modified) compiler-rt/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cpp (+3)
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cpp
index de96e573ab844..18f5da2f23b14 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cpp
@@ -38,6 +38,7 @@ using namespace __sanitizer;
#include "sanitizer_common/sanitizer_common_interceptors_format.inc"
static const unsigned I = sizeof(int);
+static const unsigned Z = sizeof(size_t);
static const unsigned L = sizeof(long);
static const unsigned LL = sizeof(long long);
static const unsigned S = sizeof(short);
@@ -113,6 +114,8 @@ static void testScanfNoGnuMalloc(const char *format, unsigned n, ...) {
TEST(SanitizerCommonInterceptors, Scanf) {
testScanf("%d", 1, I);
+ testScanf("%zx", 1, Z);
+ testScanf("%zd", 1, Z);
testScanf("%d%d%d", 3, I, I, I);
testScanf("ab%u%dc", 2, I, I);
testScanf("%ld", 1, L);
``````````
</details>
https://github.com/llvm/llvm-project/pull/128448
More information about the llvm-commits
mailing list