Index: test/asan/TestCases/Linux/asan_preload_test-2.cc
===================================================================
--- test/asan/TestCases/Linux/asan_preload_test-2.cc
+++ test/asan/TestCases/Linux/asan_preload_test-2.cc
@@ -10,11 +10,11 @@
 
 #include <stdlib.h>
 
-extern "C" void *memset(void *p, int val, size_t n);
+extern "C" ssize_t write(int fd, const void *buf, size_t count);
 
 void do_access(void *p) {
   // CHECK: AddressSanitizer: heap-buffer-overflow
-  memset(p, 0, 2);
+  write(1, p, 2);
 }
 
 int main(int argc, char **argv) {