[llvm-branch-commits] [compiler-rt-branch] r270398 - Merging r261723:

Mohit K. Bhakkad via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 23 00:05:38 PDT 2016


Author: mohit.bhakkad
Date: Mon May 23 02:02:26 2016
New Revision: 270398

URL: http://llvm.org/viewvc/llvm-project?rev=270398&view=rev
Log:
Merging r261723:
------------------------------------------------------------------------
r261723 | mohit.bhakkad | 2016-02-24 13:44:41 +0530 (Wed, 24 Feb 2016) | 7 lines

[MSan] fix process_vm_readv test: Exit silently if syscall is not implemeted

Reviewers: eugenis

Subscribers: jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17560
------------------------------------------------------------------------

Modified:
    compiler-rt/branches/release_38/   (props changed)
    compiler-rt/branches/release_38/test/msan/Linux/process_vm_readv.cc

Propchange: compiler-rt/branches/release_38/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 23 02:02:26 2016
@@ -1 +1 @@
-/compiler-rt/trunk:258916,259755,260669,260839,260946,261073,261142,261148,261193,261263,261513,261721
+/compiler-rt/trunk:258916,259755,260669,260839,260946,261073,261142,261148,261193,261263,261513,261721,261723

Modified: compiler-rt/branches/release_38/test/msan/Linux/process_vm_readv.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_38/test/msan/Linux/process_vm_readv.cc?rev=270398&r1=270397&r2=270398&view=diff
==============================================================================
--- compiler-rt/branches/release_38/test/msan/Linux/process_vm_readv.cc (original)
+++ compiler-rt/branches/release_38/test/msan/Linux/process_vm_readv.cc Mon May 23 02:02:26 2016
@@ -9,26 +9,31 @@
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <unistd.h>
+#include <errno.h>
 
 typedef ssize_t (*process_vm_readwritev_fn)(pid_t, const iovec *, unsigned long,
                                             const iovec *, unsigned long,
                                             unsigned long);
 
-int main(void) {
-  // This requires glibc 2.15.
-  process_vm_readwritev_fn libc_process_vm_readv =
-      (process_vm_readwritev_fn)dlsym(RTLD_NEXT, "process_vm_readv");
-  if (!libc_process_vm_readv) {
 // Exit with success, emulating the expected output.
+int exit_dummy()
+{
 #ifdef POSITIVE
-    printf("process_vm_readv not found!\n");
+    printf("process_vm_readv not found or not implemented!\n");
     printf(
         "WARNING: MemorySanitizer: use-of-uninitialized-value (not really)\n");
     return 1;
 #else
     return 0;
 #endif
-  }
+}
+
+int main(void) {
+  // This requires glibc 2.15.
+  process_vm_readwritev_fn libc_process_vm_readv =
+      (process_vm_readwritev_fn)dlsym(RTLD_NEXT, "process_vm_readv");
+  if (!libc_process_vm_readv)
+    return exit_dummy();
 
   process_vm_readwritev_fn process_vm_readv =
       (process_vm_readwritev_fn)dlsym(RTLD_DEFAULT, "process_vm_readv");
@@ -44,6 +49,9 @@ int main(void) {
 
   __msan_poison(&b, sizeof(b));
   ssize_t res = process_vm_readv(getpid(), iov_b, 2, iov_a, 2, 0);
+  if (errno == ENOSYS) // Function not implemented 
+    return exit_dummy();
+
   assert(res == 30);
   __msan_check_mem_is_initialized(b + 10, 10);
   __msan_check_mem_is_initialized(b + 30, 20);




More information about the llvm-branch-commits mailing list