Evgeniy Stepanov | f1d9411 | 2013-10-14 15:17:05 +0000 | [diff] [blame^] | 1 | // RUN: %clangxx_msan -m64 -O0 %s -o %t && %t |
| 2 | // RUN: %clangxx_msan -DPOSITIVE -m64 -O0 %s -o %t && not %t 2>&1 | FileCheck %s |
| 3 | |
| 4 | #include <emmintrin.h> |
| 5 | |
| 6 | int 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 |
| 11 | // CHECK: #{{.*}} in to_int{{.*}}vector_cvt.cc:[[@LINE-4]] |
| 12 | } |
| 13 | |
| 14 | int 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 | } |