brintos

brintos / llvm-project-archived public Read only

0
0
Text · 649 B · 48b84ef Raw
23 lines · cpp
1// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t >%t.out 2>&12// RUN: FileCheck %s < %t.out3 4// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 -g %s -o %t && %run %t >%t.out 2>&15// RUN: FileCheck %s < %t.out6 7// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 -g %s -o %t && %run %t >%t.out 2>&18// RUN: FileCheck %s < %t.out9 10#include <sanitizer/msan_interface.h>11 12int main(void) {13  char *p = new char[16];14  __msan_dump_shadow(p, 5);15  delete[] p;16  const char *q = "abc";17  __msan_dump_shadow(q, 3);18  return 0;19}20 21// CHECK: 0x{{[0-9a-f]+}}[0x{{[0-9a-f]+}}]  ff ff ff ff ff22// CHECK: 0x{{[0-9a-f]+}}[0x{{[0-9a-f]+}}]  00 00 0023