[msan][test] Fix cpusetsize for another pthread_getaffinity_np.cpp test
authorFangrui Song <i@maskray.me>
Thu, 9 Jun 2022 03:08:05 +0000 (20:08 -0700)
committerFangrui Song <i@maskray.me>
Thu, 9 Jun 2022 03:08:05 +0000 (20:08 -0700)
Similar to D127368

compiler-rt/test/msan/Linux/pthread_getaffinity_np.cpp
compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_getaffinity_np.cpp

index 41adb7d..e87b898 100644 (file)
@@ -6,10 +6,10 @@
 #include <sanitizer/msan_interface.h>
 
 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;
 }
index b9b072f..e878a89 100644 (file)
@@ -5,10 +5,6 @@
 // sched_getaffinity).
 // UNSUPPORTED: android
 
-#ifndef _GNU_SOURCE
-#  define _GNU_SOURCE
-#endif
-
 #include <assert.h>
 #include <pthread.h>
 #include <sys/sysinfo.h>