Richard Smith | b35fc3d | 2017-05-01 21:49:54 +0000 | [diff] [blame] | 1 | // REQUIRES: crash-recovery, shell, system-darwin |
Bruno Cardoso Lopes | 82ec4fde | 2016-12-22 07:06:03 +0000 | [diff] [blame] | 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:g" -e "s:OUT_DIR:%t/example:g" \ |
| 7 | // RUN: %S/../VFS/Inputs/vfsoverlay2.yaml > %t/srcvfs.yaml |
| 8 | |
| 9 | // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \ |
Francis Ricci | e267103 | 2017-09-29 15:46:27 +0000 | [diff] [blame] | 10 | // RUN: ASAN_OPTIONS=detect_leaks=0 \ |
Bruno Cardoso Lopes | 82ec4fde | 2016-12-22 07:06:03 +0000 | [diff] [blame] | 11 | // RUN: %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', |
Bruno Cardoso Lopes | 82ec4fde | 2016-12-22 07:06:03 +0000 | [diff] [blame] | 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" |