summaryrefslogtreecommitdiff
path: root/lib/msan/lit_tests/dlerror.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msan/lit_tests/dlerror.cc')
-rw-r--r--lib/msan/lit_tests/dlerror.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/msan/lit_tests/dlerror.cc b/lib/msan/lit_tests/dlerror.cc
new file mode 100644
index 00000000..281b3164
--- /dev/null
+++ b/lib/msan/lit_tests/dlerror.cc
@@ -0,0 +1,14 @@
+// RUN: %clangxx_msan -m64 -O0 %s -o %t && %t
+
+#include <assert.h>
+#include <dlfcn.h>
+#include <stdio.h>
+#include <string.h>
+
+int main(void) {
+ void *p = dlopen("/bad/file/name", RTLD_NOW);
+ assert(!p);
+ char *s = dlerror();
+ printf("%s, %zu\n", s, strlen(s));
+ return 0;
+}