Richard Smith | b35fc3d | 2017-05-01 21:49:54 +0000 | [diff] [blame] | 1 | // REQUIRES: crash-recovery, shell, system-darwin |
Bruno Cardoso Lopes | 181225b | 2016-12-11 04:27:28 +0000 | [diff] [blame] | 2 | |
Bruno Cardoso Lopes | 181225b | 2016-12-11 04:27:28 +0000 | [diff] [blame] | 3 | // RUN: rm -rf %t |
Bruno Cardoso Lopes | dc3f88a | 2018-06-21 21:45:24 +0000 | [diff] [blame] | 4 | // RUN: mkdir -p %t/m %t/i/Foo.framework/Headers |
Bruno Cardoso Lopes | 181225b | 2016-12-11 04:27:28 +0000 | [diff] [blame] | 5 | // RUN: echo '// Foo.h' > %t/i/Foo.framework/Headers/Foo.h |
Benjamin Kramer | 9b10b69 | 2018-06-22 09:46:40 +0000 | [diff] [blame] | 6 | // RUN: %hmaptool write %S/../Preprocessor/Inputs/headermap-rel/foo.hmap.json %t/i/foo.hmap |
Bruno Cardoso Lopes | 181225b | 2016-12-11 04:27:28 +0000 | [diff] [blame] | 7 | |
| 8 | // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \ |
| 9 | // RUN: %clang -fsyntax-only -fmodules -fmodules-cache-path=%t/m %s \ |
| 10 | // RUN: -I %t/i/foo.hmap -F %t/i 2>&1 | FileCheck %s |
| 11 | |
| 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 | |
| 16 | #include "Foo.h" |
| 17 | #include "Foo.h" |
| 18 | |
| 19 | // CHECK: Preprocessed source(s) and associated run script(s) are located at: |
| 20 | // CHECK-NEXT: note: diagnostic msg: {{.*}}.m |
| 21 | // CHECK-NEXT: note: diagnostic msg: {{.*}}.cache |
| 22 | |
| 23 | // CHECKSH: # Crash reproducer |
| 24 | // CHECKSH-NEXT: # Driver args: "-fsyntax-only" |
| 25 | // CHECKSH-NEXT: # Original command: {{.*$}} |
| 26 | // CHECKSH-NEXT: "-cc1" |
| 27 | // CHECKSH: "-I" "/[[INCPATH:.*]]/foo.hmap" |
| 28 | // CHECKSH: "crash-vfs-{{[^ ]*}}.m" |
| 29 | // CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml" |
| 30 | // CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules" |
| 31 | |
| 32 | // CHECKYAML: 'case-sensitive': |
| 33 | // CHECKYAML-NEXT: 'use-external-names': 'false', |
| 34 | // CHECKYAML-NEXT: 'overlay-relative': 'true', |
Bruno Cardoso Lopes | 181225b | 2016-12-11 04:27:28 +0000 | [diff] [blame] | 35 | // CHECKYAML: 'type': 'directory' |
Bruno Cardoso Lopes | 66e9627 | 2016-12-11 04:27:31 +0000 | [diff] [blame] | 36 | // CHECKYAML: 'name': "/[[PATH:.*]]/Foo.framework/Headers", |
| 37 | // CHECKYAML-NEXT: 'contents': [ |
| 38 | // CHECKYAML-NEXT: { |
| 39 | // CHECKYAML-NEXT: 'type': 'file', |
| 40 | // CHECKYAML-NEXT: 'name': "Foo.h", |
| 41 | // CHECKYAML-NEXT: 'external-contents': "/[[PATH]]/Foo.framework/Headers/Foo.h" |
| 42 | // CHECKYAML: 'type': 'directory' |
Bruno Cardoso Lopes | 181225b | 2016-12-11 04:27:28 +0000 | [diff] [blame] | 43 | // CHECKYAML: 'name': "/[[PATH:.*]]/i", |
| 44 | // CHECKYAML-NEXT: 'contents': [ |
| 45 | // CHECKYAML-NEXT: { |
| 46 | // CHECKYAML-NEXT: 'type': 'file', |
| 47 | // CHECKYAML-NEXT: 'name': "foo.hmap", |
| 48 | // CHECKYAML-NEXT: 'external-contents': "/[[PATH]]/i/foo.hmap" |