1*673dc3d4SNico Weber // Check that ASan can print reproducer cmdline for failed binary if desired.
2*673dc3d4SNico Weber //
3*673dc3d4SNico Weber // RUN: %clang_asan %s -o %t-exe
4*673dc3d4SNico Weber //
5*673dc3d4SNico Weber // RUN: env not %run %t-exe 2>&1 | FileCheck %s
6*673dc3d4SNico Weber // RUN: %env_asan_opts=print_cmdline=false not %run %t-exe 2>&1 | FileCheck %s
7*673dc3d4SNico Weber // RUN: %env_asan_opts=print_cmdline=true not %run %t-exe first second/third [fourth] 2>&1 | FileCheck %s --check-prefix CHECK-PRINT
8*673dc3d4SNico Weber 
9*673dc3d4SNico Weber volatile int ten = 10;
10*673dc3d4SNico Weber 
main()11*673dc3d4SNico Weber int main() {
12*673dc3d4SNico Weber   char x[10];
13*673dc3d4SNico Weber   // CHECK-NOT: Command:
14*673dc3d4SNico Weber   // CHECK-PRINT: {{Command: .*-exe first second/third \[fourth\]}}
15*673dc3d4SNico Weber   x[ten] = 1; // BOOM
16*673dc3d4SNico Weber   return  0;
17*673dc3d4SNico Weber }
18*673dc3d4SNico Weber 
19