[PATCH] D33152: [PowerPC] Fix test case sem_init_glibc.cc for powerpc64be

Bill Seurer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 14:07:24 PDT 2017


seurer created this revision.
Herald added subscribers: nemanjai, kubamracek.

On powerpc64be semval_t must be 64 bits even with "old" versions of glibc.  This was discovered on a new install of Redhat 7.3 which unfortunately still comes with glibc 2.17 installed.


https://reviews.llvm.org/D33152

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
@@ -8,8 +8,12 @@
 #include <string.h>
 #include <stdint.h>
 
+// On powerpc64be semval_t must be 64 bits even with "old" versions of glibc.
+#if __PPC64__ && __BIG_ENDIAN__
+typedef uint64_t semval_t;
+
 // This condition needs to correspond to __HAVE_64B_ATOMICS macro in glibc.
-#if (defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) || \
+#elif (defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) || \
      defined(__s390x__) || defined(__sparc64__) || defined(__alpha__) || \
      defined(__ia64__) || defined(__m68k__)) && __GLIBC_PREREQ(2, 21)
 typedef uint64_t semval_t;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33152.98841.patch
Type: text/x-patch
Size: 870 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170512/14a1f148/attachment.bin>


More information about the llvm-commits mailing list