diff --git a/tests/core/templates/test_rid.h b/tests/core/templates/test_rid.h index bcc267c50d1..04945aa2406 100644 --- a/tests/core/templates/test_rid.h +++ b/tests/core/templates/test_rid.h @@ -37,6 +37,7 @@ #include "tests/test_macros.h" +#ifdef THREADS_ENABLED #ifdef SANITIZERS_ENABLED #ifdef __has_feature #if __has_feature(thread_sanitizer) @@ -45,7 +46,8 @@ #elif defined(__SANITIZE_THREAD__) #define TSAN_ENABLED #endif -#endif +#endif // SANITIZERS_ENABLED +#endif // THREADS_ENABLED #ifdef TSAN_ENABLED #include @@ -113,6 +115,7 @@ TEST_CASE("[RID] 'get_local_index'") { CHECK(RID::from_uint64(4'294'967'297).get_local_index() == 1); } +#ifdef THREADS_ENABLED // This case would let sanitizers realize data races. // Additionally, on purely weakly ordered architectures, it would detect synchronization issues // if RID_Alloc failed to impose proper memory ordering and the test's threads are distributed @@ -248,4 +251,6 @@ TEST_CASE("[RID_Owner] Thread safety") { tester.test(); } } +#endif // THREADS_ENABLED + } // namespace TestRID