[compiler-rt] r224812 - [ASan] Fix asan_preload_test-2 on PowerPC64 Linux

Jay Foad jay.foad at gmail.com
Wed Dec 24 03:48:41 PST 2014


Author: foad
Date: Wed Dec 24 05:48:40 2014
New Revision: 224812

URL: http://llvm.org/viewvc/llvm-project?rev=224812&view=rev
Log:
[ASan] Fix asan_preload_test-2 on PowerPC64 Linux

Summary:
This test failed because clang compiled the call to memset() into a
single sth instruction, instead of a call. Fix it by using write() instead
of memset().

Reviewers: kcc, samsonov, garious, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6776

Modified:
    compiler-rt/trunk/test/asan/TestCases/Linux/asan_preload_test-2.cc

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/asan_preload_test-2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/asan_preload_test-2.cc?rev=224812&r1=224811&r2=224812&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/asan_preload_test-2.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/asan_preload_test-2.cc Wed Dec 24 05:48:40 2014
@@ -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) {





More information about the llvm-commits mailing list