[compiler-rt] 7b1aa20 - [MSAN] Add result printing for failed call in pthread_getaffinity_np.

Kevin Athey via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 11:14:28 PDT 2022


Author: Kevin Athey
Date: 2022-06-08T11:14:24-07:00
New Revision: 7b1aa20a767cdb8a44745456d1986fe501fcac54

URL: https://github.com/llvm/llvm-project/commit/7b1aa20a767cdb8a44745456d1986fe501fcac54
DIFF: https://github.com/llvm/llvm-project/commit/7b1aa20a767cdb8a44745456d1986fe501fcac54.diff

LOG: [MSAN] Add result printing for failed call in pthread_getaffinity_np.

Will be reverted when test failure is diagnosed.

Depends on: https://reviews.llvm.org/D127185

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D127320

Added: 
    

Modified: 
    compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_getaffinity_np.cpp

Removed: 
    


################################################################################
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 18db1c6a12199..d3872d43a4dc2 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
@@ -4,6 +4,7 @@
 
 #include <assert.h>
 #include <pthread.h>
+#include <stdio.h>
 #include <sys/sysinfo.h>
 
 #include <sanitizer/msan_interface.h>
@@ -11,6 +12,8 @@
 int main() {
   cpu_set_t set_x;
   int res = pthread_getaffinity_np(pthread_self(), sizeof(set_x), &set_x);
+  if (res != 0)
+    printf("res: %d\n", res);
   assert(res == 0);
   assert(CPU_COUNT_S(sizeof(set_x), &set_x) == get_nprocs());
 


        


More information about the llvm-commits mailing list