[PATCH] D17147: [MSAN] Add support for big endian byte order to the test ptrtoint

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 13:55:11 PST 2016


eugenis added a comment.

Could you check if this works for you:

TEST(MemorySanitizer, ptrtoint) {

  // Test that shadow is propagated through pointer-to-integer conversion.                                                      
  unsigned char c = 0;
  __msan_poison(&c, 1);
  uintptr_t u = (uintptr_t)c << 8;
  EXPECT_NOT_POISONED(u & 0xFF00FF);
  EXPECT_POISONED(u & 0xFF00);
  
  break_optimization(&u);
  void* p = (void*)u;
  
  break_optimization(&p);
  EXPECT_POISONED(p);
  EXPECT_NOT_POISONED(((uintptr_t)p) & 0xFF00FF);
  EXPECT_POISONED(((uintptr_t)p) & 0xFF00);

}


Repository:
  rL LLVM

http://reviews.llvm.org/D17147





More information about the llvm-commits mailing list