fix(test): use __SANITIZE_ADDRESS__ alone for sanitizer detection (gcc-portable)

GCC's preprocessor doesn't short-circuit 'defined(__has_feature) && __has_feature(...)' — it tries to parse the call syntax of the undefined token and errors with 'missing binary operator before token "("'. Modern GCC and Clang both define __SANITIZE_ADDRESS__ under -fsanitize=address, so use that single check.
This commit is contained in:
Martin Vogel committed 2026-05-29 22:30:03 +02:00
1 parent d5211f6ae0
commit 297003aab4
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -242,7 +242,7 @@ TEST(cslsp_bench_resolution_ratio) {
/* Time budget. ASan+UBSan instrumentation slows the parse ~5-10×, so
* scale the budget when a sanitizer is active. Native: 200 ms for a
* ~260-line fixture; sanitized: 2000 ms. */
#if defined(__SANITIZE_ADDRESS__) || (defined(__has_feature) && __has_feature(address_sanitizer))
#ifdef __SANITIZE_ADDRESS__
ASSERT(ms < 2000.0);
#else
ASSERT(ms < 200.0);
+1 -1
View File
@@ -262,7 +262,7 @@ TEST(pylsp_bench_resolution_ratio) {
/* Time budget. ASan+UBSan instrumentation slows the parse ~5-10×, so
* scale the budget when a sanitizer is active. Native: 150 ms for a
* ~200-line fixture; sanitized: 1500 ms. */
#if defined(__SANITIZE_ADDRESS__) || (defined(__has_feature) && __has_feature(address_sanitizer))
#ifdef __SANITIZE_ADDRESS__
ASSERT(ms < 1500.0);
#else
ASSERT(ms < 150.0);