[AA] Rename CaptureInfo -> CaptureAnalysis (NFC) (#116842)
[llvm-project.git] / compiler-rt / test / msan / select_float_origin.cpp
blob730b18c57b16371f8521ade7d88c422e826c4ceb
1 // Regression test for origin propagation in "select i1, float, float".
2 // https://code.google.com/p/memory-sanitizer/issues/detail?id=78
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
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
10 #include <stdio.h>
11 #include <sanitizer/msan_interface.h>
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;