1// RUN: %clangxx -O0 %s -o %t
2// RUN: %env_tool_opts=help=1,include_if_exists=___some_path_that_does_not_exist___ %run %t 2>&1 | FileCheck %s
3// RUN: %env_tool_opts=help=1,symbolize=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-CV %s
4// RUN: %env_tool_opts=help=1,sancov_path=/long/path/that/requires/truncation/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaB \
5// RUN: %run %t 2>&1 | FileCheck --check-prefix=CHECK-TRUNCATION %s
6
7int main() {
8}
9
10// CHECK: Available flags for {{.*}}Sanitizer:
11
12//
13// Bool option
14// CHECK: {{^[ \t]+symbolize$}}
15// CHECK-NEXT: (Current Value: true)
16//
17// String option
18// CHECK: {{^[ \t]+log_path$}}
19// CHECK-NEXT: (Current Value: {{.+}})
20//
21// int option
22// CHECK: {{^[ \t]+verbosity$}}
23// CHECK-NEXT: (Current Value: {{-?[0-9]+}})
24//
25// HandleSignalMode option
26// CHECK: {{^[ \t]+handle_segv$}}
27// CHECK-NEXT: (Current Value: {{0|1|2}})
28//
29// uptr option
30// CHECK: {{^[ \t]+mmap_limit_mb$}}
31// CHECK-NEXT: (Current Value: 0x{{[0-9a-fA-F]+}})
32//
33// FlagHandlerInclude option
34// CHECK: include_if_exists
35// CHECK-NEXT: (Current Value: ___some_path_that_does_not_exist___)
36
37// Test we show the current value and not the default.
38// CHECK-CV: {{^[ \t]+symbolize$}}
39// CHECK-CV-NEXT: (Current Value: false)
40
41// Test truncation of long paths.
42// CHECK-TRUNCATION: sancov_path
43// CHECK-TRUNCATION-NEXT: (Current Value Truncated: /long/path/that/requires/truncation/aaa{{a+}})
44

source code of compiler-rt/test/sanitizer_common/TestCases/options-help.cpp