2015-03-03 03:34:27 +08:00
|
|
|
// RUN: %clangxx_msan -O0 %s -o %t && %run %t
|
|
|
|
// RUN: %clangxx_msan -DPOSITIVE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
|
2016-02-23 09:58:56 +08:00
|
|
|
// REQUIRES: x86_64-target-arch
|
2013-10-14 23:17:05 +08:00
|
|
|
|
|
|
|
#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
|
2014-06-09 17:09:19 +08:00
|
|
|
// CHECK: #{{.*}} in to_int{{.*}}vector_cvt.cc:[[@LINE-3]]
|
2013-10-14 23:17:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
#ifdef POSITIVE
|
|
|
|
double v;
|
|
|
|
#else
|
|
|
|
double v = 1.1;
|
|
|
|
#endif
|
|
|
|
double* volatile p = &v;
|
|
|
|
int x = to_int(*p);
|
|
|
|
return !x;
|
|
|
|
}
|