57 lines · plain
1// REQUIRES: crash-recovery, shell, system-darwin2 3// RUN: rm -rf %t4// RUN: mkdir -p %t/i %t/m %t5 6// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \7// RUN: not %clang -fsyntax-only -nostdinc %s \8// RUN: -I %S/Inputs/crash-recovery/usr/include -isysroot %/t/i/ \9// RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s10 11// RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m12// RUN: FileCheck --check-prefix=CHECKSH %s -input-file %t/crash-vfs-*.sh13// RUN: FileCheck --check-prefix=CHECKYAML %s -input-file \14// RUN: %t/crash-vfs-*.cache/vfs/vfs.yaml15// RUN: find %t/crash-vfs-*.cache/vfs | \16// RUN: grep "Inputs/crash-recovery/usr/include/stdio.h" | count 117 18#include <stdio.h>19 20// CHECK: Preprocessed source(s) and associated run script(s) are located at:21// CHECK-NEXT: note: diagnostic msg: {{.*}}.m22// CHECK-NEXT: note: diagnostic msg: {{.*}}.cache23 24// CHECKSRC: #pragma clang module import cstd.stdio25 26// CHECKSH: # Crash reproducer27// CHECKSH-NEXT: # Driver args: "-fsyntax-only"28// CHECKSH-NEXT: # Original command: {{.*$}}29// CHECKSH-NEXT: "-cc1"30// CHECKSH: "-resource-dir"31// CHECKSH: "-isysroot" "{{[^"]*}}/i/"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:.*]]/Inputs/crash-recovery/usr/include",41// CHECKYAML-NEXT: 'contents': [42// CHECKYAML-NEXT: {43// CHECKYAML-NEXT: 'type': 'file',44// CHECKYAML-NEXT: 'name': "module.modulemap",45// CHECKYAML-NOT: 'external-contents': "{{[^ ]*}}.cache46// CHECKYAML-NEXT: 'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.modulemap"47// CHECKYAML-NEXT: },48 49// Run the reproducer script - regular exit code is enough to test it works.50// Note that we don't yet support reusing the modules pcm; what we do51// support is re-building the modules relying solely on the header files dumped52// inside .cache/vfs, mapped by .cache/vfs/vfs.yaml.53 54// RUN: cd %t55// RUN: chmod 755 crash-vfs-*.sh56// RUN: bash ./crash-vfs-*.sh57