Skip to content

[NFC][sanitizer] Add test for length sub-specifier "z" #128448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

vitalybuka
Copy link
Collaborator

No description provided.

Created using spr 1.3.4
@llvmbot
Copy link
Member

llvmbot commented Feb 24, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Vitaly Buka (vitalybuka)

Changes

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

@vitalybuka vitalybuka added the skip-precommit-approval PR for CI feedback, not intended for review label Feb 24, 2025
@vitalybuka vitalybuka merged commit 8c917f3 into main Feb 24, 2025
14 checks passed
@vitalybuka vitalybuka deleted the users/vitalybuka/spr/nfcsanitizer-add-test-for-length-sub-specifier-z branch February 24, 2025 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-rt:sanitizer compiler-rt skip-precommit-approval PR for CI feedback, not intended for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants