[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

llvm-svn: 224812
This commit is contained in:
Jay Foad 2014-12-24 11:48:40 +00:00
parent 58cb80c940
commit 4195dff0fb
1 changed files with 2 additions and 2 deletions

View File

@ -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) {