[compiler-rt] 8c917f3 - [NFC][sanitizer] Add test for length sub-specifier "z" (#128448)

via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 23 18:30:44 PST 2025


Author: Vitaly Buka
Date: 2025-02-23T18:30:40-08:00
New Revision: 8c917f3ccdefe77c180aebc6de41c6828d7aa548

URL: https://github.com/llvm/llvm-project/commit/8c917f3ccdefe77c180aebc6de41c6828d7aa548
DIFF: https://github.com/llvm/llvm-project/commit/8c917f3ccdefe77c180aebc6de41c6828d7aa548.diff

LOG: [NFC][sanitizer] Add test for length sub-specifier "z" (#128448)

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cpp

Removed: 
    


################################################################################
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);


        


More information about the llvm-commits mailing list