From 62309ed955e223d2d67754c1565e2295b0761164 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 8 Jun 2022 20:08:05 -0700 Subject: [PATCH] [msan][test] Fix cpusetsize for another pthread_getaffinity_np.cpp test Similar to D127368 --- compiler-rt/test/msan/Linux/pthread_getaffinity_np.cpp | 6 +++--- .../TestCases/Linux/pthread_getaffinity_np.cpp | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/compiler-rt/test/msan/Linux/pthread_getaffinity_np.cpp b/compiler-rt/test/msan/Linux/pthread_getaffinity_np.cpp index 41adb7de5f91..e87b898a7bc5 100644 --- a/compiler-rt/test/msan/Linux/pthread_getaffinity_np.cpp +++ b/compiler-rt/test/msan/Linux/pthread_getaffinity_np.cpp @@ -6,10 +6,10 @@ #include int main() { - cpu_set_t set_x; - int res = pthread_getaffinity_np(pthread_self(), sizeof(set_x), &set_x); + cpu_set_t set_x[4]; + int res = pthread_getaffinity_np(pthread_self(), sizeof(set_x), set_x); assert(res == 0); - __msan_check_mem_is_initialized(&set_x, sizeof(set_x)); + __msan_check_mem_is_initialized(set_x, sizeof(set_x)); return 0; } diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_getaffinity_np.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_getaffinity_np.cpp index b9b072fa352a..e878a8914cf7 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_getaffinity_np.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_getaffinity_np.cpp @@ -5,10 +5,6 @@ // sched_getaffinity). // UNSUPPORTED: android -#ifndef _GNU_SOURCE -# define _GNU_SOURCE -#endif - #include #include #include