brintos

brintos / llvm-project-archived public Read only

0
0
Text · 620 B · 47695ab Raw
23 lines · cpp
1// RUN: %clangxx_msan %s -fno-sanitize-memory-param-retval -o %t && %run %t >%t.out 2>&12// RUN: FileCheck %s --check-prefix=MISSED --allow-empty < %t.out3// RUN: %clangxx_msan %s -mllvm -msan-eager-checks=1 -fno-sanitize-memory-param-retval -o %t && not %run %t >%t.out 2>&14// RUN: FileCheck %s < %t.out5 6struct SimpleStruct {7  int md1;8};9 10static int sink;11 12static void examineValue(int x) { sink = x; }13 14int main(int argc, char *argv[]) {15  auto ss = new SimpleStruct;16  examineValue(ss->md1);17 18  return 0;19}20 21// CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value22// MISSED-NOT: use-of-uninitialized-value23