projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7176799
)
[msan] Break optimization in memccpy tests
author
Nikita Popov
<npopov@redhat.com>
Wed, 22 Dec 2021 13:43:52 +0000
(14:43 +0100)
committer
Nikita Popov
<npopov@redhat.com>
Wed, 22 Dec 2021 13:45:20 +0000
(14:45 +0100)
After D116148 the memccpy gets optimized away and the expected
uninitialized memory access does not occur.
Make sure the call does not get optimized away.
compiler-rt/lib/msan/tests/msan_test.cpp
patch
|
blob
|
history
diff --git
a/compiler-rt/lib/msan/tests/msan_test.cpp
b/compiler-rt/lib/msan/tests/msan_test.cpp
index
085e904
..
00b736e
100644
(file)
--- a/
compiler-rt/lib/msan/tests/msan_test.cpp
+++ b/
compiler-rt/lib/msan/tests/msan_test.cpp
@@
-1560,6
+1560,7
@@
TEST(MemorySanitizer, memccpy_nomatch_positive) {
char* y = new char[5];
strcpy(x, "abc");
EXPECT_UMR(memccpy(y, x, 'd', 5));
+ break_optimization(y);
delete[] x;
delete[] y;
}
@@
-1570,6
+1571,7
@@
TEST(MemorySanitizer, memccpy_match_positive) {
x[0] = 'a';
x[2] = 'b';
EXPECT_UMR(memccpy(y, x, 'b', 5));
+ break_optimization(y);
delete[] x;
delete[] y;
}