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

Phabricator reviews at reviews.llvm.org
Mon Feb 16 05:33:06 PST 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7341

Files:
  compiler-rt/trunk/lib/msan/tests/msan_test.cc

Index: compiler-rt/trunk/lib/msan/tests/msan_test.cc
===================================================================
--- compiler-rt/trunk/lib/msan/tests/msan_test.cc
+++ compiler-rt/trunk/lib/msan/tests/msan_test.cc
@@ -168,11 +168,11 @@
     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];

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7341.20028.patch
Type: text/x-patch
Size: 684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150216/a6f6f80f/attachment.bin>


More information about the llvm-commits mailing list