brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 3684924 Raw
63 lines · plain
1// UNSUPPORTED: system-windows2// REQUIRES: crash-recovery3 4// FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?5// XFAIL: target={{.*-windows-gnu}}6 7// RUN: rm -rf %t8// RUN: mkdir -p %t/i %t/m %t9 10// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \11// RUN: not %clang -fsyntax-only -nostdinc %s \12// RUN:     -I %S/Inputs/crash-recovery/usr/include -isysroot %/t/i/ \13// RUN:     -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s14 15// RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m16// RUN: FileCheck --check-prefix=CHECKSH %s -input-file %t/crash-vfs-*.sh17// RUN: FileCheck --check-prefix=CHECKYAML %s -input-file \18// RUN: %t/crash-vfs-*.cache/vfs/vfs.yaml19// RUN: find %t/crash-vfs-*.cache/vfs | \20// RUN:   grep "Inputs/crash-recovery/usr/include/stdio.h" | count 121 22#include <stdio.h>23 24// CHECK: Preprocessed source(s) and associated run script(s) are located at:25// CHECK-NEXT: note: diagnostic msg: {{.*}}.m26// CHECK-NEXT: note: diagnostic msg: {{.*}}.cache27 28// CHECKSRC: #pragma clang module import cstd.stdio29 30// CHECKSH: # Crash reproducer31// CHECKSH-NEXT: # Driver args: "-fsyntax-only"32// CHECKSH-NEXT: # Original command: {{.*$}}33// CHECKSH-NEXT: "-cc1"34// CHECKSH: "-resource-dir"35// CHECKSH: "-isysroot" "{{[^"]*}}/i/"36// CHECKSH: "crash-vfs-{{[^ ]*}}.m"37// CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"38// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"39 40// CHECKYAML: 'case-sensitive':41// CHECKYAML-NEXT: 'use-external-names': 'false',42// CHECKYAML-NEXT: 'overlay-relative': 'true',43// CHECKYAML: 'type': 'directory'44// CHECKYAML: 'name': "/[[PATH:.*]]/Inputs/crash-recovery/usr/include",45// CHECKYAML-NEXT: 'contents': [46// CHECKYAML-NEXT:   {47// CHECKYAML-NEXT:     'type': 'file',48// CHECKYAML-NEXT:     'name': "module.modulemap",49// CHECKYAML-NOT:      'external-contents': "{{[^ ]*}}.cache50// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.modulemap"51// CHECKYAML-NEXT:   },52 53// Test that reading the YAML file will yield the correct path after54// the overlay dir is prefixed to access headers in .cache/vfs directory.55 56// RUN: env -u FORCE_CLANG_DIAGNOSTICS_CRASH \57// RUN: %clang -E %s -I %S/Inputs/crash-recovery/usr/include -isysroot %/t/i/ \58// RUN:     -ivfsoverlay %t/crash-vfs-*.cache/vfs/vfs.yaml -fmodules \59// RUN:     -fmodules-cache-path=%t/m/ 2>&1 \60// RUN:     | FileCheck %s --check-prefix=CHECKOVERLAY61 62// CHECKOVERLAY: #pragma clang module import cstd.stdio /* clang -E: implicit import63