summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-10-14 15:17:05 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-10-14 15:17:05 +0000
commitf1d9411c39d1efdfcbf3ea928198089e52123646 (patch)
tree563cdbfb66216483836dd0dd23e400a93b866163
parentc519335c2d6d32acaac32c0595f08a05081567e7 (diff)
downloadcompiler-rt-f1d9411c39d1efdfcbf3ea928198089e52123646.tar.gz
compiler-rt-f1d9411c39d1efdfcbf3ea928198089e52123646.tar.bz2
compiler-rt-f1d9411c39d1efdfcbf3ea928198089e52123646.tar.xz
[msan] Test for r192599.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192600 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/msan/lit_tests/vector_cvt.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/msan/lit_tests/vector_cvt.cc b/lib/msan/lit_tests/vector_cvt.cc
new file mode 100644
index 00000000..c200c77d
--- /dev/null
+++ b/lib/msan/lit_tests/vector_cvt.cc
@@ -0,0 +1,23 @@
+// RUN: %clangxx_msan -m64 -O0 %s -o %t && %t
+// RUN: %clangxx_msan -DPOSITIVE -m64 -O0 %s -o %t && not %t 2>&1 | FileCheck %s
+
+#include <emmintrin.h>
+
+int to_int(double v) {
+ __m128d t = _mm_set_sd(v);
+ int x = _mm_cvtsd_si32(t);
+ return x;
+ // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
+ // CHECK: #{{.*}} in to_int{{.*}}vector_cvt.cc:[[@LINE-4]]
+}
+
+int main() {
+#ifdef POSITIVE
+ double v;
+#else
+ double v = 1.1;
+#endif
+ double* volatile p = &v;
+ int x = to_int(*p);
+ return !x;
+}