Home | History | Annotate | Download | only in Driver
      1 // RUN: rm -rf %t
      2 // RUN: mkdir %t
      3 // RUN: not env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1              \
      4 // RUN:  CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1                         \
      5 // RUN:  %clang -fsyntax-only %s                                         \
      6 // RUN:  -F/tmp/ -I /tmp/ -idirafter /tmp/ -iquote /tmp/ -isystem /tmp/  \
      7 // RUN:  -iprefix /the/prefix -iwithprefix /tmp -iwithprefixbefore /tmp/ \
      8 // RUN:  -Xclang -internal-isystem -Xclang /tmp/                         \
      9 // RUN:  -Xclang -internal-externc-isystem -Xclang /tmp/                 \
     10 // RUN:  -Xclang -main-file-name -Xclang foo.c                           \
     11 // RUN:  -DFOO=BAR -DBAR="BAZ QUX" 2>&1 | FileCheck %s
     12 // RUN: cat %t/crash-report-*.c | FileCheck --check-prefix=CHECKSRC %s
     13 // RUN: cat %t/crash-report-*.sh | FileCheck --check-prefix=CHECKSH %s
     14 // REQUIRES: crash-recovery
     15 
     16 // because of the glob (*.c, *.sh)
     17 // REQUIRES: shell
     18 
     19 #pragma clang __debug parser_crash
     20 // CHECK: Preprocessed source(s) and associated run script(s) are located at:
     21 // CHECK-NEXT: note: diagnostic msg: {{.*}}crash-report-{{.*}}.c
     22 FOO
     23 // CHECKSRC: FOO
     24 // CHECKSH: # Crash reproducer
     25 // CHECKSH-NEXT: # Driver args: "-fsyntax-only"
     26 // CHECKSH-SAME: "-D" "FOO=BAR"
     27 // CHECKSH-SAME: "-D" "BAR=BAZ QUX"
     28 // CHECKSH-NEXT: # Original command: {{.*$}}
     29 // CHECKSH-NEXT: "-cc1"
     30 // CHECKSH: "-main-file-name" "crash-report.c"
     31 // CHECKSH-NOT: "-header-include-file"
     32 // CHECKSH-NOT: "-diagnostic-log-file"
     33 // CHECKSH: "-D" "FOO=BAR"
     34 // CHECKSH: "-D" "BAR=BAZ QUX"
     35 // CHECKSH-NOT: "-F/tmp/"
     36 // CHECKSH-NOT: "-I" "/tmp/"
     37 // CHECKSH-NOT: "-idirafter" "/tmp/"
     38 // CHECKSH-NOT: "-iquote" "/tmp/"
     39 // CHECKSH-NOT: "-isystem" "/tmp/"
     40 // CHECKSH-NOT: "-iprefix" "/the/prefix"
     41 // CHECKSH-NOT: "-iwithprefix" "/tmp/"
     42 // CHECKSH-NOT: "-iwithprefixbefore" "/tmp/"
     43 // CHECKSH-NOT: "-internal-isystem" "/tmp/"
     44 // CHECKSH-NOT: "-internal-externc-isystem" "/tmp/"
     45 // CHECKSH-NOT: "-dwarf-debug-flags"
     46 // CHECKSH: "crash-report-{{[^ ]*}}.c"
     47