[Msan] Improve the EXPECT_NOT_POISONED() macro to provide the original line number

Differential Revision: http://reviews.llvm.org/D7341

llvm-svn: 229389
This commit is contained in:
Viktor Kutuzov 2015-02-16 13:30:52 +00:00
parent b1f54eeed4
commit 37a79210cb
1 changed files with 3 additions and 3 deletions

View File

@ -168,11 +168,11 @@ void ExpectPoisonedWithOrigin(const T& t, unsigned origin) {
EXPECT_EQ(origin, __msan_get_origin((void*)&t));
}
#define EXPECT_NOT_POISONED(x) ExpectNotPoisoned(x)
#define EXPECT_NOT_POISONED(x) EXPECT_EQ(true, TestForNotPoisoned((x)))
template<typename T>
void ExpectNotPoisoned(const T& t) {
EXPECT_EQ(-1, __msan_test_shadow((void*)&t, sizeof(t)));
bool TestForNotPoisoned(const T& t) {
return __msan_test_shadow((void*)&t, sizeof(t)) == -1;
}
static U8 poisoned_array[100];