summaryrefslogtreecommitdiff
path: root/test/msan/setlocale.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/msan/setlocale.cc')
-rw-r--r--test/msan/setlocale.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/msan/setlocale.cc b/test/msan/setlocale.cc
new file mode 100644
index 0000000000000..b7007f78da7cd
--- /dev/null
+++ b/test/msan/setlocale.cc
@@ -0,0 +1,13 @@
+// RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t
+
+#include <assert.h>
+#include <locale.h>
+#include <stdlib.h>
+
+int main(void) {
+ char *locale = setlocale (LC_ALL, "");
+ assert(locale);
+ if (locale[0])
+ exit(0);
+ return 0;
+}