[ASan/Win] Add a comment about DCL-using-static vs threads
[blocksruntime.git] / test / msan / select_origin.cc
blobe832c02e99ced335c08226b9c4585d7c9b2e534f
1 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
3 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
5 // Test condition origin propagation through "select" IR instruction.
7 #include <stdio.h>
8 #include <stdint.h>
10 __attribute__((noinline))
11 int *max_by_ptr(int *a, int *b) {
12 return *a < *b ? b : a;
15 int main(void) {
16 int x;
17 int *volatile px = &x;
18 int y = 43;
19 int *p = max_by_ptr(px, &y);
20 // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main'
21 return *p;