[PATCH] D37829: [mips] Fix sem_init_glibc test.

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 14:47:03 PDT 2017


sdardis created this revision.
Herald added subscribers: fedor.sergeev, arichardson, kubamracek.

glibc changed the implementation of semaphores for glibc 2.21 requiring
some target specific changes for this compiler-rt test. Modify the test
to cope with MIPS64 and do some future/correctness work by tying the
define for MIPS64 to exactly the define of __HAVE_64B_ATOMICS in glibc.

Contributions from Nitesh Jain.


https://reviews.llvm.org/D37829

Files:
  test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc


Index: test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc
===================================================================
--- test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc
+++ test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc
@@ -13,9 +13,11 @@
 typedef uint64_t semval_t;
 
 // This condition needs to correspond to __HAVE_64B_ATOMICS macro in glibc.
-#elif (defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) || \
-     defined(__s390x__) || defined(__sparc64__) || defined(__alpha__) || \
-     defined(__ia64__) || defined(__m68k__)) && __GLIBC_PREREQ(2, 21)
+#elif (defined(__x86_64__) || defined(__aarch64__) ||                          \
+       defined(__powerpc64__) || defined(__s390x__) || defined(__sparc64__) || \
+       defined(__alpha__) || defined(__ia64__) || defined(__m68k__) ||         \
+       (defined(__mips64) || _MIPS_SIM == _ABI64)) &&                          \
+    __GLIBC_PREREQ(2, 21)
 typedef uint64_t semval_t;
 #else
 typedef unsigned semval_t;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37829.115123.patch
Type: text/x-patch
Size: 1025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170913/cfcf1912/attachment.bin>


More information about the llvm-commits mailing list