summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan/tests/msan_test.cc
diff options
context:
space:
mode:
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