| 1 |
// REQUIRES: crash-recovery |
| 2 |
// File path separator differences. |
| 3 |
// UNSUPPORTED: system-windows |
| 4 |
|
| 5 |
// RUN: rm -rf %t |
| 6 |
// RUN: mkdir -p %t/i %t/m %t |
| 7 |
// RUN: cp -R %S/Inputs/crash-recovery/Frameworks %t/i/ |
| 8 |
// RUN: mkdir -p %t/i/Frameworks/A.framework/Frameworks |
| 9 |
// RUN: ln -s ../../B.framework %t/i/Frameworks/A.framework/Frameworks/B.framework |
| 10 |
|
| 11 |
// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \ |
| 12 |
// RUN: not %clang -nostdinc -fsyntax-only %s \ |
| 13 |
// RUN: -F %/t/i/Frameworks -fmodules \ |
| 14 |
// RUN: -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s |
| 15 |
|
| 16 |
// RUN: FileCheck --check-prefix=CHECKYAML %s -input-file \ |
| 17 |
// RUN: %t/crash-vfs-*.cache/vfs/vfs.yaml |
| 18 |
// RUN: find %t/crash-vfs-*.cache/vfs | \ |
| 19 |
// RUN: grep "B.framework/Headers/B.h" | count 1 |
| 20 |
|
| 21 |
// CHECK: Preprocessed source(s) and associated run script(s) are located at: |
| 22 |
// CHECK-NEXT: note: diagnostic msg: {{.*}}.m |
| 23 |
// CHECK-NEXT: note: diagnostic msg: {{.*}}.cache |
| 24 |
|
| 25 |
// CHECKYAML: 'type': 'directory', |
| 26 |
// CHECKYAML: 'name': "/[[PATH:.*]]/i/Frameworks/B.framework/Headers", |
| 27 |
// CHECKYAML-NEXT: 'contents': [ |
| 28 |
// CHECKYAML-NEXT: { |
| 29 |
// CHECKYAML-NEXT: 'type': 'file', |
| 30 |
// CHECKYAML-NEXT: 'name': "B.h", |
| 31 |
// CHECKYAML-NEXT: 'external-contents': "/[[PATH]]/i/Frameworks/B.framework/Headers/B.h" |
| 32 |
|
| 33 |
@import I; |
| 34 |
|
| 35 |
// Run the reproducer script - regular exit code is enough to test it works. The |
| 36 |
// intent here is to guarantee that the collect umbrella headers into the VFS |
| 37 |
// can be used, testing that vfs::recursive_directory_iterator is used correctly |
| 38 |
// Make sure to erase the include paths used to build the modules to guarantee |
| 39 |
// that the VFS overlay won't fallback to use it. Also wipe out the module cache |
| 40 |
// to force header search. |
| 41 |
// |
| 42 |
// RUN: cd %t |
| 43 |
// RUN: rm -rf i |
| 44 |
// RUN: rm -rf crash-vfs-umbrella-*.cache/modules/* |
| 45 |
// RUN: chmod 755 crash-vfs-*.sh |
| 46 |
// RUN: bash ./crash-vfs-*.sh |