summaryrefslogtreecommitdiff
path: root/test/msan/msan_print_shadow3.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/msan/msan_print_shadow3.cc')
-rw-r--r--test/msan/msan_print_shadow3.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/msan/msan_print_shadow3.cc b/test/msan/msan_print_shadow3.cc
new file mode 100644
index 0000000000000..c605ef18886d1
--- /dev/null
+++ b/test/msan/msan_print_shadow3.cc
@@ -0,0 +1,16 @@
+// RUN: %clangxx_msan -m64 -O0 -g %s -o %t && %run %t >%t.out 2>&1
+// RUN: FileCheck %s < %t.out
+
+#include <stdint.h>
+#include <sanitizer/msan_interface.h>
+
+int main(void) {
+ unsigned long long x = 0; // For 8-byte alignment.
+ uint32_t x_s = 0x12345678U;
+ __msan_partial_poison(&x, &x_s, sizeof(x_s));
+ __msan_print_shadow(&x, sizeof(x_s));
+ return 0;
+}
+
+// CHECK: Shadow map of [{{.*}}), 4 bytes:
+// CHECK: 0x{{.*}}: 87654321 ........ ........ ........