summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan/tests/msan_test.cc
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-07-02 14:49:24 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-07-02 14:49:24 +0000
commitaa23bd83e5dc4612adfa4359737d9bbe8a243c34 (patch)
treeffcc70e94d88e4471fd7bc7165175644f3042035 /compiler-rt/lib/msan/tests/msan_test.cc
parente4cc98686af16d2126dc06f6cb6cafd13e89e675 (diff)
downloadbcm5719-llvm-aa23bd83e5dc4612adfa4359737d9bbe8a243c34.tar.gz
bcm5719-llvm-aa23bd83e5dc4612adfa4359737d9bbe8a243c34.zip
[msan] Intercept mempcpy, wmempcpy.
llvm-svn: 185431
Diffstat (limited to 'compiler-rt/lib/msan/tests/msan_test.cc')
-rw-r--r--compiler-rt/lib/msan/tests/msan_test.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler-rt/lib/msan/tests/msan_test.cc b/compiler-rt/lib/msan/tests/msan_test.cc
index dd869f8e1b8..a6095d118aa 100644
--- a/compiler-rt/lib/msan/tests/msan_test.cc
+++ b/compiler-rt/lib/msan/tests/msan_test.cc
@@ -2485,6 +2485,7 @@ void MemCpyTest() {
T *x = new T[N];
T *y = new T[N];
T *z = new T[N];
+ T *q = new T[N];
__msan_poison(x, N * sizeof(T));
__msan_set_origin(x, N * sizeof(T), ox);
__msan_set_origin(y, N * sizeof(T), 777777);
@@ -2495,6 +2496,12 @@ void MemCpyTest() {
EXPECT_POISONED_O(y[N/2], ox);
EXPECT_POISONED_O(y[N-1], ox);
EXPECT_NOT_POISONED(x);
+ void *res = mempcpy(q, x, N * sizeof(T));
+ ASSERT_EQ(q + N, res);
+ EXPECT_POISONED_O(q[0], ox);
+ EXPECT_POISONED_O(q[N/2], ox);
+ EXPECT_POISONED_O(q[N-1], ox);
+ EXPECT_NOT_POISONED(x);
memmove(z, x, N * sizeof(T));
EXPECT_POISONED_O(z[0], ox);
EXPECT_POISONED_O(z[N/2], ox);
OpenPOWER on IntegriCloud