1 // REQUIRES: crash-recovery, shell, system-darwin
4 // RUN: mkdir -p %t/m %t/out
6 // RUN: %clang_cc1 -x objective-c-header -emit-pch %S/Inputs/pch-used.h \
7 // RUN: -o %t/out/pch-used.h.pch -fmodules -fimplicit-module-maps \
8 // RUN: -fbuiltin-headers-in-system-modules -fmodules-cache-path=%t/cache -O0 \
9 // RUN: -isystem %S/Inputs/System/usr/include
11 // RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
12 // RUN: not %clang %s -E -include-pch %t/out/pch-used.h.pch -fmodules -nostdlibinc \
13 // RUN: -fimplicit-module-maps -Xclang -fbuiltin-headers-in-system-modules \
14 // RUN: -fmodules-cache-path=%t/cache -O0 -Xclang -fno-validate-pch \
15 // RUN: -isystem %S/Inputs/System/usr/include -o %t/output.E 2>&1 | FileCheck %s
17 // RUN: FileCheck --check-prefix=CHECKSH %s -input-file %t/crash-vfs-*.sh
18 // RUN: FileCheck --check-prefix=CHECKYAML %s -input-file \
19 // RUN: %t/crash-vfs-*.cache/vfs/vfs.yaml
21 void f() { SPXTrace(); }
22 void g() { double x = DBL_MAX; }
24 // CHECK: Preprocessed source(s) and associated run script(s) are located at:
25 // CHECK-NEXT: note: diagnostic msg: {{.*}}.m
26 // CHECK-NEXT: note: diagnostic msg: {{.*}}.cache
28 // CHECKSH: "-include-pch" "/[[INCPATH:.*]]/out/pch-used.h.pch"
29 // CHECKSH: "crash-vfs-{{[^ ]*}}.m"
30 // CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
31 // CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"
33 // CHECKYAML: 'case-sensitive':
34 // CHECKYAML-NEXT: 'use-external-names': 'false',
35 // CHECKYAML-NEXT: 'overlay-relative': 'true',
36 // CHECKYAML: 'type': 'directory'
37 // CHECKYAML: 'name': "/[[PATH:.*]]/out",
38 // CHECKYAML-NEXT: 'contents': [
40 // CHECKYAML-NEXT: 'type': 'file',
41 // CHECKYAML-NEXT: 'name': "pch-used.h.pch",
42 // CHECKYAML-NEXT: 'external-contents': "/[[PATH]]/out/pch-used.h.pch"