[llvm-commits] [compiler-rt] r173154 - /compiler-rt/trunk/lib/msan/tests/msan_test.cc
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Tue Jan 22 04:31:40 PST 2013
Author: eugenis
Date: Tue Jan 22 06:31:39 2013
New Revision: 173154
URL: http://llvm.org/viewvc/llvm-project?rev=173154&view=rev
Log:
[msan] Test handling of volatile bitfields.
Modified:
compiler-rt/trunk/lib/msan/tests/msan_test.cc
Modified: compiler-rt/trunk/lib/msan/tests/msan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/msan_test.cc?rev=173154&r1=173153&r2=173154&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/tests/msan_test.cc (original)
+++ compiler-rt/trunk/lib/msan/tests/msan_test.cc Tue Jan 22 06:31:39 2013
@@ -1325,6 +1325,22 @@
EXPECT_UMR(applySlt<S4>(0xF, 0xFFFFFFFF));
}
+// Volatile bitfield store is implemented as load-mask-store
+// Test that we don't warn on the store of (uninitialized) padding.
+struct VolatileBitfieldStruct {
+ volatile unsigned x : 1;
+ unsigned y : 1;
+};
+
+TEST(MemorySanitizer, VolatileBitfield) {
+ VolatileBitfieldStruct *S = new VolatileBitfieldStruct;
+ S->x = 1;
+ unsigned tmp = S->x;
+ EXPECT_NOT_POISONED(tmp);
+ tmp = S->y;
+ EXPECT_POISONED(S->y);
+}
+
TEST(MemorySanitizerDr, StoreInDSOTest) {
if (!__msan_has_dynamic_component()) return;
char* s = new char[10];
More information about the llvm-commits
mailing list