Bruno Cardoso Lopes | b3a0fa4 | 2016-05-13 22:21:51 +0000 | [diff] [blame] | 1 | // REQUIRES: crash-recovery, shell |
| 2 | |
| 3 | // FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it? |
Petr Hosek | eb46c95 | 2018-08-09 02:16:18 +0000 | [diff] [blame] | 4 | // XFAIL: windows-gnu |
Bruno Cardoso Lopes | b3a0fa4 | 2016-05-13 22:21:51 +0000 | [diff] [blame] | 5 | |
| 6 | // RUN: rm -rf %t |
| 7 | // RUN: mkdir -p %t/i %t/m %t |
Hubert Tong | 8fbad0a | 2018-01-04 01:15:52 +0000 | [diff] [blame] | 8 | // RUN: cp -R %S/Inputs/crash-recovery/Frameworks %t/i/ |
Bruno Cardoso Lopes | b3a0fa4 | 2016-05-13 22:21:51 +0000 | [diff] [blame] | 9 | // RUN: mkdir -p %t/i/Frameworks/A.framework/Frameworks |
| 10 | // RUN: ln -s ../../B.framework %t/i/Frameworks/A.framework/Frameworks/B.framework |
| 11 | |
| 12 | // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \ |
| 13 | // RUN: %clang -nostdinc -fsyntax-only %s \ |
| 14 | // RUN: -F %/t/i/Frameworks -fmodules \ |
| 15 | // RUN: -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s |
| 16 | |
| 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 "B.framework/Headers/B.h" | count 1 |
| 21 | |
| 22 | // CHECK: Preprocessed source(s) and associated run script(s) are located at: |
| 23 | // CHECK-NEXT: note: diagnostic msg: {{.*}}.m |
| 24 | // CHECK-NEXT: note: diagnostic msg: {{.*}}.cache |
| 25 | |
| 26 | // CHECKYAML: 'type': 'directory', |
| 27 | // CHECKYAML: 'name': "/[[PATH:.*]]/i/Frameworks/A.framework/Frameworks/B.framework/Headers", |
| 28 | // CHECKYAML-NEXT: 'contents': [ |
| 29 | // CHECKYAML-NEXT: { |
| 30 | // CHECKYAML-NEXT: 'type': 'file', |
| 31 | // CHECKYAML-NEXT: 'name': "B.h", |
| 32 | // CHECKYAML-NEXT: 'external-contents': "/[[PATH]]/i/Frameworks/B.framework/Headers/B.h" |
| 33 | |
| 34 | // CHECKYAML: 'type': 'directory', |
| 35 | // CHECKYAML: 'name': "/[[PATH]]/i/Frameworks/B.framework/Headers", |
| 36 | // CHECKYAML-NEXT: 'contents': [ |
| 37 | // CHECKYAML-NEXT: { |
| 38 | // CHECKYAML-NEXT: 'type': 'file', |
| 39 | // CHECKYAML-NEXT: 'name': "B.h", |
| 40 | // CHECKYAML-NEXT: 'external-contents': "/[[PATH]]/i/Frameworks/B.framework/Headers/B.h" |
| 41 | |
| 42 | @import I; |
Bruno Cardoso Lopes | b171a59 | 2016-05-16 16:46:01 +0000 | [diff] [blame] | 43 | |
| 44 | // Run the reproducer script - regular exit code is enough to test it works. The |
| 45 | // intent here is to guarantee that the collect umbrella headers into the VFS |
| 46 | // can be used, testing that vfs::recursive_directory_iterator is used correctly |
| 47 | // Make sure to erase the include paths used to build the modules to guarantee |
| 48 | // that the VFS overlay won't fallback to use it. Also wipe out the module cache |
| 49 | // to force header search. |
| 50 | // |
| 51 | // RUN: cd %t |
| 52 | // RUN: rm -rf i |
| 53 | // RUN: rm -rf crash-vfs-umbrella-*.cache/modules/* |
| 54 | // RUN: chmod 755 crash-vfs-*.sh |
| 55 | // RUN: ./crash-vfs-*.sh |