[libc] Switch to using the generic `<gpuintrin.h>` implementations (#121810)
[llvm-project.git] / compiler-rt / test / msan / select_origin.cpp
blob81e7af819b288ade23bbda6ee6e439ff042a3195
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
21 return *p;