diff options
author | Nikita Popov <npopov@redhat.com> | 2021-12-22 14:43:52 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2021-12-22 14:45:20 +0100 |
commit | a9bb97e8410b09446c8d6da3b7bb493f79a4aaea (patch) | |
tree | 745c5574460066443183fa4c832d00514da98774 | |
parent | 7176799a7e196fa41046f9c77ebd65335b339acd (diff) | |
download | llvm-a9bb97e8410b09446c8d6da3b7bb493f79a4aaea.zip llvm-a9bb97e8410b09446c8d6da3b7bb493f79a4aaea.tar.gz llvm-a9bb97e8410b09446c8d6da3b7bb493f79a4aaea.tar.bz2 |
[msan] Break optimization in memccpy tests
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.
-rw-r--r-- | compiler-rt/lib/msan/tests/msan_test.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler-rt/lib/msan/tests/msan_test.cpp b/compiler-rt/lib/msan/tests/msan_test.cpp index 085e904..00b736e 100644 --- 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; } |