aboutsummaryrefslogtreecommitdiff
path: root/test/msan/Linux/mallinfo.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/msan/Linux/mallinfo.cc')
-rw-r--r--test/msan/Linux/mallinfo.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/msan/Linux/mallinfo.cc b/test/msan/Linux/mallinfo.cc
new file mode 100644
index 000000000000..3c3692969852
--- /dev/null
+++ b/test/msan/Linux/mallinfo.cc
@@ -0,0 +1,12 @@
+// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
+
+#include <assert.h>
+#include <malloc.h>
+
+#include <sanitizer/msan_interface.h>
+
+int main(void) {
+ struct mallinfo mi = mallinfo();
+ assert(__msan_test_shadow(&mi, sizeof(mi)) == -1);
+ return 0;
+}