blob: d08ec3e3dc708763ac7fa624eb4378fe7bcd750b [file] [log] [blame]
Pirama Arumuga Nainar7c915052015-04-08 08:58:29 -07001// 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
Stephen Hines2d1fdb22014-05-28 23:58:16 -07003
4#include <emmintrin.h>
5
6int to_int(double v) {
7 __m128d t = _mm_set_sd(v);
8 int x = _mm_cvtsd_si32(t);
9 return x;
10 // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
Stephen Hines6a211c52014-07-21 00:49:56 -070011 // CHECK: #{{.*}} in to_int{{.*}}vector_cvt.cc:[[@LINE-3]]
Stephen Hines2d1fdb22014-05-28 23:58:16 -070012}
13
14int main() {
15#ifdef POSITIVE
16 double v;
17#else
18 double v = 1.1;
19#endif
20 double* volatile p = &v;
21 int x = to_int(*p);
22 return !x;
23}