mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 15:41:46 +00:00
[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.
This commit is contained in:
parent
7176799a7e
commit
a9bb97e841
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user