]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Modules/crash-vfs-relative-incdir.m
Vendor import of clang trunk r290819:
[FreeBSD/FreeBSD.git] / test / Modules / crash-vfs-relative-incdir.m
1 // REQUIRES: crash-recovery, shell, system-darwin
2
3 // RUN: rm -rf %t
4 // RUN: mkdir -p %t/m
5 // RUN: cd %S/Inputs/crash-recovery/usr
6
7 // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
8 // RUN: %clang -fsyntax-only -nostdinc %s -Iinclude \
9 // RUN:     -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
10
11 // RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m
12 // RUN: FileCheck --check-prefix=CHECKSH %s -input-file %t/crash-vfs-*.sh
13 // RUN: FileCheck --check-prefix=CHECKYAML %s -input-file \
14 // RUN: %t/crash-vfs-*.cache/vfs/vfs.yaml
15 // RUN: find %t/crash-vfs-*.cache/vfs | \
16 // RUN:   grep "Inputs/crash-recovery/usr/include/stdio.h" | count 1
17
18 #include <stdio.h>
19
20 // CHECK: Preprocessed source(s) and associated run script(s) are located at:
21 // CHECK-NEXT: note: diagnostic msg: {{.*}}.m
22 // CHECK-NEXT: note: diagnostic msg: {{.*}}.cache
23
24 // CHECKSRC: @import cstd.stdio;
25
26 // CHECKSH: # Crash reproducer
27 // CHECKSH-NEXT: # Driver args: "-fsyntax-only"
28 // CHECKSH-NEXT: # Original command: {{.*$}}
29 // CHECKSH-NEXT: "-cc1"
30 // CHECKSH: "-resource-dir"
31 // CHECKSH: "-I" "/[[INCPATH:.*]]/include"
32 // CHECKSH: "crash-vfs-{{[^ ]*}}.m"
33 // CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
34 // CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"
35
36 // CHECKYAML: 'case-sensitive':
37 // CHECKYAML-NEXT: 'use-external-names': 'false',
38 // CHECKYAML-NEXT: 'overlay-relative': 'true',
39 // CHECKYAML-NEXT: 'ignore-non-existent-contents': 'false'
40 // CHECKYAML: 'type': 'directory'
41 // CHECKYAML: 'name': "/[[PATH:.*]]/Inputs/crash-recovery/usr/include",
42 // CHECKYAML-NEXT: 'contents': [
43 // CHECKYAML-NEXT:   {
44 // CHECKYAML-NEXT:     'type': 'file',
45 // CHECKYAML-NEXT:     'name': "module.map",
46 // CHECKYAML-NOT:      'external-contents': "{{[^ ]*}}.cache
47 // CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.map"
48 // CHECKYAML-NEXT:   },
49
50 // Run the reproducer script - regular exit code is enough to test it works.
51 // Note that we don't yet support reusing the modules pcm; what we do
52 // support is re-building the modules relying solely on the header files dumped
53 // inside .cache/vfs, mapped by .cache/vfs/vfs.yaml.
54
55 // RUN: cd %t
56 // RUN: chmod 755 crash-vfs-*.sh
57 // RUN: ./crash-vfs-*.sh