brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 680cda3 Raw
69 lines · plain
1// REQUIRES: crash-recovery2// UNSUPPORTED: ms-sdk, target={{.*-(ps4|ps5)}}3// Some assertions in this test use Linux style (/) file paths.4// UNSUPPORTED: system-windows5 6// FIXME: Canonicalizing paths to remove relative traversal components7// currenty fails a unittest on windows and is disable by default.8// FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?9// XFAIL: target={{.*-windows-gnu}}10 11// RUN: rm -rf %t12// RUN: mkdir -p %t/i %t/m %t13 14// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \15// RUN: not %clang -fsyntax-only %s -I %S/Inputs/crash-recovery -isysroot %/t/i/ \16// RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s17 18// RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m19// RUN: FileCheck --check-prefix=CHECKSH %s -input-file %t/crash-vfs-*.sh20// RUN: FileCheck --check-prefix=CHECKYAML %s -input-file \21// RUN: %t/crash-vfs-*.cache/vfs/vfs.yaml22// RUN: find %t/crash-vfs-*.cache/vfs | \23// RUN:   grep "Inputs/crash-recovery/usr/include/stdio.h" | count 124 25#include "usr/././//////include/../include/./././../include/stdio.h"26 27// CHECK: Preprocessed source(s) and associated run script(s) are located at:28// CHECK-NEXT: note: diagnostic msg: {{.*}}.m29// CHECK-NEXT: note: diagnostic msg: {{.*}}.cache30 31// CHECKSRC: #pragma clang module import cstd.stdio32 33// CHECKSH: # Crash reproducer34// CHECKSH-NEXT: # Driver args: "-fsyntax-only"35// CHECKSH-NEXT: # Original command: {{.*$}}36// CHECKSH-NEXT: "-cc1"37// CHECKSH: "-isysroot" "{{[^"]*}}/i/"38// CHECKSH-NOT: "-fmodules-cache-path="39// CHECKSH: "crash-vfs-{{[^ ]*}}.m"40// CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"41// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"42 43// CHECKYAML: 'case-sensitive':44// CHECKYAML-NEXT: 'use-external-names': 'false',45// CHECKYAML-NEXT: 'overlay-relative': 'true',46// CHECKYAML:     'type': 'directory'47// CHECKYAML:     'name': "/[[PATH:.*]]/Inputs/crash-recovery/usr/include",48// CHECKYAML-NEXT: 'contents': [49// CHECKYAML-NEXT:   {50// CHECKYAML-NEXT:     'type': 'file',51// CHECKYAML-NEXT:     'name': "module.modulemap",52// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.modulemap"53// CHECKYAML-NEXT:   },54 55// Replace the paths in the YAML files with relative ".." traversals56// and fed into clang to test whether we're correctly representing them57// in the VFS overlay.58 59// RUN: sed -e "s@usr/include@usr/include/../include@g" \60// RUN:     %t/crash-vfs-*.cache/vfs/vfs.yaml > %t/vfs.yaml61// RUN: cp %t/vfs.yaml %t/crash-vfs-*.cache/vfs/vfs.yaml62// RUN: env -u FORCE_CLANG_DIAGNOSTICS_CRASH \63// RUN: %clang -E %s -I %S/Inputs/crash-recovery -isysroot %/t/i/ \64// RUN:     -ivfsoverlay %t/crash-vfs-*.cache/vfs/vfs.yaml -fmodules \65// RUN:     -fmodules-cache-path=%t/m/ 2>&1 \66// RUN:     | FileCheck %s --check-prefix=CHECKOVERLAY67 68// CHECKOVERLAY: #pragma clang module import cstd.stdio /* clang -E: implicit import69