• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// REQUIRES: crash-recovery, system-darwin
2
3// RUN: rm -rf %t
4// RUN: mkdir -p %t/m
5// RUN: cp %S/../VFS/Inputs/actual_module2.map %t/actual_module2.map
6// RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" -e "s@OUT_DIR@%{/t:regex_replacement}/example@g" \
7// RUN:   %S/../VFS/Inputs/vfsoverlay2.yaml > %t/srcvfs.yaml
8
9// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
10// RUN:         ASAN_OPTIONS=detect_leaks=0 \
11// RUN: not %clang -fsyntax-only -nostdinc %s \
12// RUN:     -I %S/Inputs/crash-recovery/usr/include \
13// RUN:     -ivfsoverlay %t/srcvfs.yaml \
14// RUN:     -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
15
16// RUN: FileCheck --check-prefix=CHECKSH %s -input-file %t/crash-vfs-*.sh
17// RUN: FileCheck --check-prefix=CHECKYAML %s -input-file \
18// RUN:   %t/crash-vfs-*.cache/vfs/vfs.yaml
19// RUN: find %t/crash-vfs-*.cache/vfs | \
20// RUN:   grep "%t/actual_module2.map" | count 1
21
22#include <stdio.h>
23
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
27
28// CHECKSH: # Crash reproducer
29// CHECKSH-NEXT: # Driver args: "-fsyntax-only"
30// CHECKSH-NEXT: # Original command: {{.*$}}
31// CHECKSH-NEXT: "-cc1"
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: 'type': 'directory'
40// CHECKYAML: 'name': "/[[PATH:.*]]/example"
41// CHECKYAML: 'contents': [
42// CHECKYAML-NEXT:   {
43// CHECKYAML-NEXT:     'type': 'file',
44// CHECKYAML-NEXT:     'name': "module.map",
45// CHECKYAML-NEXT:     'external-contents': "/[[OTHERPATH:.*]]/actual_module2.map"
46