]> git.proxmox.com Git - rustc.git/blame - src/compiler-rt/test/msan/vector_cvt.cc
New upstream version 1.12.0+dfsg1
[rustc.git] / src / compiler-rt / test / msan / vector_cvt.cc
CommitLineData
92a42be0
SL
1// RUN: %clangxx_msan -O0 %s -o %t && %run %t
2// RUN: %clangxx_msan -DPOSITIVE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
5bcae85e 3// REQUIRES: x86_64-target-arch
1a4d82fc
JJ
4
5#include <emmintrin.h>
6
7int to_int(double v) {
8 __m128d t = _mm_set_sd(v);
9 int x = _mm_cvtsd_si32(t);
10 return x;
11 // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
92a42be0 12 // CHECK: #{{.*}} in to_int{{.*}}vector_cvt.cc:[[@LINE-3]]
1a4d82fc
JJ
13}
14
15int main() {
16#ifdef POSITIVE
17 double v;
18#else
19 double v = 1.1;
20#endif
21 double* volatile p = &v;
22 int x = to_int(*p);
23 return !x;
24}