summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/msan/setlocale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/msan/setlocale.cpp')
-rw-r--r--compiler-rt/test/msan/setlocale.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler-rt/test/msan/setlocale.cpp b/compiler-rt/test/msan/setlocale.cpp
new file mode 100644
index 00000000000..796f4454e6a
--- /dev/null
+++ b/compiler-rt/test/msan/setlocale.cpp
@@ -0,0 +1,13 @@
+// RUN: %clangxx_msan -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;
+}
OpenPOWER on IntegriCloud