1 // REQUIRES: crash-recovery, shell, system-darwin
3 // This uses a headermap with this entry:
6 // Copy out the headermap from test/Preprocessor/Inputs/headermap-rel and avoid
7 // adding another binary format to the repository.
11 // RUN: cp -a %S/../Preprocessor/Inputs/headermap-rel %t/i
12 // RUN: echo '// Foo.h' > %t/i/Foo.framework/Headers/Foo.h
14 // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
15 // RUN: %clang -fsyntax-only -fmodules -fmodules-cache-path=%t/m %s \
16 // RUN: -I %t/i/foo.hmap -F %t/i 2>&1 | FileCheck %s
18 // RUN: FileCheck --check-prefix=CHECKSH %s -input-file %t/crash-vfs-*.sh
19 // RUN: FileCheck --check-prefix=CHECKYAML %s -input-file \
20 // RUN: %t/crash-vfs-*.cache/vfs/vfs.yaml
25 // CHECK: Preprocessed source(s) and associated run script(s) are located at:
26 // CHECK-NEXT: note: diagnostic msg: {{.*}}.m
27 // CHECK-NEXT: note: diagnostic msg: {{.*}}.cache
29 // CHECKSH: # Crash reproducer
30 // CHECKSH-NEXT: # Driver args: "-fsyntax-only"
31 // CHECKSH-NEXT: # Original command: {{.*$}}
32 // CHECKSH-NEXT: "-cc1"
33 // CHECKSH: "-I" "/[[INCPATH:.*]]/foo.hmap"
34 // CHECKSH: "crash-vfs-{{[^ ]*}}.m"
35 // CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
36 // CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"
38 // CHECKYAML: 'case-sensitive':
39 // CHECKYAML-NEXT: 'use-external-names': 'false',
40 // CHECKYAML-NEXT: 'overlay-relative': 'true',
41 // CHECKYAML-NEXT: 'ignore-non-existent-contents': 'false'
42 // CHECKYAML: 'type': 'directory'
43 // CHECKYAML: 'name': "/[[PATH:.*]]/Foo.framework/Headers",
44 // CHECKYAML-NEXT: 'contents': [
46 // CHECKYAML-NEXT: 'type': 'file',
47 // CHECKYAML-NEXT: 'name': "Foo.h",
48 // CHECKYAML-NEXT: 'external-contents': "/[[PATH]]/Foo.framework/Headers/Foo.h"
49 // CHECKYAML: 'type': 'directory'
50 // CHECKYAML: 'name': "/[[PATH:.*]]/i",
51 // CHECKYAML-NEXT: 'contents': [
53 // CHECKYAML-NEXT: 'type': 'file',
54 // CHECKYAML-NEXT: 'name': "foo.hmap",
55 // CHECKYAML-NEXT: 'external-contents': "/[[PATH]]/i/foo.hmap"