]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Modules/crash-vfs-headermaps.m
Vendor import of clang trunk r290819:
[FreeBSD/FreeBSD.git] / test / Modules / crash-vfs-headermaps.m
1 // REQUIRES: crash-recovery, shell, system-darwin
2
3 // This uses a headermap with this entry:
4 //   Foo.h -> Foo/Foo.h
5
6 // Copy out the headermap from test/Preprocessor/Inputs/headermap-rel and avoid
7 // adding another binary format to the repository.
8
9 // RUN: rm -rf %t
10 // RUN: mkdir -p %t/m
11 // RUN: cp -a %S/../Preprocessor/Inputs/headermap-rel %t/i
12 // RUN: echo '// Foo.h' > %t/i/Foo.framework/Headers/Foo.h
13
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
17
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
21
22 #include "Foo.h"
23 #include "Foo.h"
24
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
28
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"
37
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': [
45 // CHECKYAML-NEXT:   {
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': [
52 // CHECKYAML-NEXT:   {
53 // CHECKYAML-NEXT:     'type': 'file',
54 // CHECKYAML-NEXT:     'name': "foo.hmap",
55 // CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/i/foo.hmap"