Files
clang-p2996/compiler-rt/test/msan/noundef_analysis.cpp
Vitaly Buka 15805c030f [tests][msan] Use -fno-sanitize-memory-param-retval in tests
Supports either default of -f[no-]sanitize-memory-param-retval.

Reviewed By: aeubanks, MaskRay

Differential Revision: https://reviews.llvm.org/D134683
2022-09-26 17:24:22 -07:00

23 lines
620 B
C++

// RUN: %clangxx_msan %s -fno-sanitize-memory-param-retval -o %t && %run %t >%t.out 2>&1
// RUN: FileCheck %s --check-prefix=MISSED --allow-empty < %t.out
// RUN: %clangxx_msan %s -mllvm -msan-eager-checks=1 -fno-sanitize-memory-param-retval -o %t && not %run %t >%t.out 2>&1
// RUN: FileCheck %s < %t.out
struct SimpleStruct {
int md1;
};
static int sink;
static void examineValue(int x) { sink = x; }
int main(int argc, char *argv[]) {
auto ss = new SimpleStruct;
examineValue(ss->md1);
return 0;
}
// CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
// MISSED-NOT: use-of-uninitialized-value