60 lines · c
1// RUN: export LSAN_OPTIONS=detect_leaks=02// RUN: rm -rf %t3// RUN: mkdir %t4 5// RUN: echo '-fsyntax-only \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"' > %t.rsp12 13// RUN: env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 \14// RUN: CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1 \15// RUN: not %clang %s @%t.rsp -DASSERT 2>&1 | FileCheck %s16// RUN: cat %t/crash-report-*.c | FileCheck --check-prefix=CHECKSRC %s17// RUN: cat %t/crash-report-*.sh | FileCheck --check-prefix=CHECKSH %s18 19// RUN: env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 \20// RUN: CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1 \21// RUN: not %clang %s @%t.rsp -DUNREACHABLE 2>&1 | FileCheck %s22// RUN: cat %t/crash-report-with-asserts-*.c | FileCheck --check-prefix=CHECKSRC %s23// RUN: cat %t/crash-report-with-asserts-*.sh | FileCheck --check-prefix=CHECKSH %s24 25// REQUIRES: crash-recovery, asserts26 27#ifdef ASSERT28#pragma clang __debug assert29#elif UNREACHABLE30#pragma clang __debug llvm_unreachable31#endif32 33// CHECK: Preprocessed source(s) and associated run script(s) are located at:34// CHECK-NEXT: note: diagnostic msg: {{.*}}crash-report-with-asserts-{{.*}}.c35FOO36// CHECKSRC: FOO37// CHECKSH: # Crash reproducer38// CHECKSH-NEXT: # Driver args: {{.*}}"-fsyntax-only"39// CHECKSH-SAME: "-D" "FOO=BAR"40// CHECKSH-SAME: "-D" "BAR=BAZ QUX"41// CHECKSH-NEXT: # Original command: {{.*$}}42// CHECKSH-NEXT: "-cc1"43// CHECKSH: "-main-file-name" "crash-report-with-asserts.c"44// CHECKSH-NOT: "-header-include-file"45// CHECKSH-NOT: "-diagnostic-log-file"46// CHECKSH: "-D" "FOO=BAR"47// CHECKSH: "-D" "BAR=BAZ QUX"48// CHECKSH-NOT: "-F/tmp/"49// CHECKSH-NOT: "-I" "/tmp/"50// CHECKSH-NOT: "-idirafter" "/tmp/"51// CHECKSH-NOT: "-iquote" "/tmp/"52// CHECKSH-NOT: "-isystem" "/tmp/"53// CHECKSH-NOT: "-iprefix" "/the/prefix"54// CHECKSH-NOT: "-iwithprefix" "/tmp/"55// CHECKSH-NOT: "-iwithprefixbefore" "/tmp/"56// CHECKSH-NOT: "-internal-isystem" "/tmp/"57// CHECKSH-NOT: "-internal-externc-isystem" "/tmp/"58// CHECKSH-NOT: "-dwarf-debug-flags"59// CHECKSH: "crash-report-with-asserts-{{[^ ]*}}.c"60