[PATCH] D24766: [sanitizers] Update sanitizers test to better match glibc internals

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 02:04:58 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL282061: [sanitizers] Update sanitizers test to better match glibc internals (authored by rovka).

Changed prior to commit:
  https://reviews.llvm.org/D24766?vs=71932&id=72016#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24766

Files:
  compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc

Index: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc
===================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc
@@ -13,8 +13,14 @@
      defined(__s390x__) || defined(__sparc64__) || defined(__alpha__) || \
      defined(__ia64__) || defined(__m68k__)) && __GLIBC_PREREQ(2, 21)
 typedef uint64_t semval_t;
+#define GET_SEM_VALUE(V) (V)
 #else
 typedef unsigned semval_t;
+#if __GLIBC_PREREQ(2, 21)
+#define GET_SEM_VALUE(V) ((V) >> 1)
+#else
+#define GET_SEM_VALUE(V) (V)
+#endif
 #endif
 
 void my_sem_init(bool priv, int value, semval_t *a, unsigned char *b) {
@@ -34,10 +40,10 @@
   unsigned char b;
 
   my_sem_init(false, 42, &a, &b);
-  assert(a == 42);
+  assert(GET_SEM_VALUE(a) == 42);
   assert(b != 0xAB);
 
   my_sem_init(true, 43, &a, &b);
-  assert(a == 43);
+  assert(GET_SEM_VALUE(a) == 43);
   assert(b != 0xAB);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24766.72016.patch
Type: text/x-patch
Size: 1026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160921/ec7f0dd4/attachment-0001.bin>


More information about the llvm-commits mailing list