Mercurial > hg > CbC > CbC_llvm
comparison compiler-rt/test/msan/select_float_origin.cpp @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
147:c2174574ed3a | 150:1d019706d866 |
---|---|
1 // Regression test for origin propagation in "select i1, float, float". | |
2 // https://code.google.com/p/memory-sanitizer/issues/detail?id=78 | |
3 | |
4 // RUN: %clangxx_msan -O2 -fsanitize-memory-track-origins %s -o %t && not %run %t >%t.out 2>&1 | |
5 // RUN: FileCheck %s < %t.out | |
6 | |
7 // RUN: %clangxx_msan -O2 -fsanitize-memory-track-origins=2 %s -o %t && not %run %t >%t.out 2>&1 | |
8 // RUN: FileCheck %s < %t.out | |
9 | |
10 #include <stdio.h> | |
11 #include <sanitizer/msan_interface.h> | |
12 | |
13 int main() { | |
14 volatile bool b = true; | |
15 float x, y; | |
16 __msan_allocated_memory(&x, sizeof(x)); | |
17 __msan_allocated_memory(&y, sizeof(y)); | |
18 float z = b ? x : y; | |
19 if (z > 0) printf(".\n"); | |
20 // CHECK: Memory was marked as uninitialized | |
21 // CHECK: {{#0 0x.* in .*__msan_allocated_memory}} | |
22 // CHECK: {{#1 0x.* in main .*select_float_origin.cpp:}}[[@LINE-6]] | |
23 return 0; | |
24 } |