Files
swift-mirror/test/Frontend/crash.swift
Allan Shortlidge b52241e381 Frontend: For whole module compiles, omit filelists from stack dumps.
For batch compile jobs, it's helpful to see which files are considered primary
and that was the original reason why filelist contents were printed in compiler
crash stack dumps. However, for whole module compile jobs, the contents of the
filelist is uninteresting (it's just all the files in the module) and can be
hundreds or thousands of lines long so it often causes important information to
be trimmed from stack dumps received in reproducers.
2024-08-26 16:42:23 -07:00

35 lines
1.7 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: echo %s > %t/primary.filelist.txt
// RUN: echo "" > %t/empty.swift
// RUN: echo "%t/empty.swift" > %t/all.filelist.txt
// RUN: echo %s >> %t/all.filelist.txt
// RUN: not --crash %target-swift-frontend -typecheck -debug-crash-after-parse -primary-filelist %t/primary.filelist.txt -filelist %t/all.filelist.txt 2>&1 | %FileCheck %s
// Check that we see the contents of the input file list in the crash log.
// CHECK-NOT: while allowing modules with compiler errors
// CHECK-LABEL: Stack dump
// CHECK-NEXT: Program arguments: {{.*swift(-frontend)?(c?)(\.exe)?}}
// CHECK-NEXT: Swift version
// CHECK-NEXT: Compiling with effective version
// CHECK-NEXT: Contents of {{.*}}/all.filelist.txt:
// CHECK-NEXT: ---
// CHECK-NEXT: {{[\\/]}}empty.swift{{$}}
// CHECK-NEXT: {{[\\/]}}crash.swift{{$}}
// CHECK-NEXT: ---
// CHECK-NEXT: Contents of {{.*}}/primary.filelist.txt:
// CHECK-NEXT: ---
// CHECK-NEXT: {{[\\/]}}crash.swift{{$}}
// CHECK-NEXT: ---
// RUN: not --crash %target-swift-frontend -typecheck -debug-crash-after-parse -experimental-allow-module-with-compiler-errors %s 2>&1 | %FileCheck -check-prefix CHECK-ALLOW %s
// CHECK-ALLOW: Program arguments: {{.*}} -experimental-allow-module-with-compiler-errors
// CHECK-ALLOW: Compiling with effective version {{.*}} while allowing modules with compiler errors
// RUN: not --crash %target-swift-frontend -typecheck -debug-crash-after-parse -experimental-allow-module-with-compiler-errors -swift-version 5 %s 2>&1 | %FileCheck -check-prefix CHECK-CURRENT %s
// CHECK-CURRENT: Program arguments: {{.*}} -experimental-allow-module-with-compiler-errors
// CHECK-CURRENT: Compiling with effective version {{.*}} while allowing modules with compiler errors
func anchor() {}
anchor()