1 // Checks that module map does not print at 0, prints once after aborting with 1,
2 // and prints once before and after aborting with 2
4 // mac header is "Process module map"
5 // other posix header is "Process memory map follows"
6 // windows header is "Dumping process modules" (ignored here)
7 // we should consider unifying the message cross platform
9 // RUN: %clangxx -DUSING_%tool_name %s -o %t -w
11 // RUN: %env_tool_opts="print_module_map=0:halt_on_error=1" not %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-MM0
12 // RUN: %env_tool_opts="print_module_map=1:halt_on_error=1" not %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-MM1
13 // RUN: %env_tool_opts="print_module_map=2:halt_on_error=1" not %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-MM2
15 // tsan support pending rdar://67747473
18 // FIXME: Add linux support.
19 // XFAIL: msan && target={{.*linux.*}}
22 // XFAIL: lsan, hwasan
27 #if defined(USING_ubsan)
29 int computation
= value
/ 0; // Division by zero.
31 volatile int *a
= new int[100];
33 global
= a
[0]; // use-after-free: triggers ASan/TSan report.
38 // CHECK-NOT: {{Process .*map}}
40 // CHECK-MM0-NOT: {{Process .*map}}
42 // CHECK-MM1: {{Process (module|memory) map}}
43 // CHECK-MM1-NOT: {{Process .*map}}
45 // CHECK-MM2: {{Process (module|memory) map}}
46 // CHECK-MM2: {{Process (module|memory) map}}
47 // CHECK-MM2-NOT: {{Process .*map}}