Files
Carl Peto a6f148efc0 [Testing] Split off friendly tests.
rdar://181843264 relates on this, we had disabled all unit tests for remote running for any tests using preset=friendly on the backtracer anywhere in the test.
This is because friendly needs access to source code files which are not present when doing remote run.
Split unit tests into a bit that can be run remotely like most tests, and a bit that uses preset=friendly that can't.
2026-07-22 13:22:39 +01:00

72 lines
2.2 KiB
Plaintext

// RUN: %empty-directory(%t)
// RUN: %target-build-swift %S/../Inputs/Crash.swift -parse-as-library -Onone %swift-debug-flags -o %t/Crash.exe
// RUN: %target-codesign %t/Crash.exe
// RUN: ! env %env-SWIFT_BACKTRACE=preset=friendly,enable=yes,cache=no %target-run %t/Crash.exe > %t/Friendly.out 2>&1
// RUN: %FileCheck %s --ignore-case --check-prefix FRIENDLY < %t/Friendly.out
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime
// UNSUPPORTED: asan
// UNSUPPORTED: remote_run
// REQUIRES: executable_test
// REQUIRES: backtracing
// REQUIRES: OS=macosx || OS=linux-gnu || OS=windows-msvc
// FRIENDLY: *** Program crashed: {{(Bad pointer dereference|Access violation)}} at 0x{{0+}}4 ***
// FRIENDLY: Thread 0 {{(".*" )?}}crashed:
// FRIENDLY: 0 level5() + {{[0-9]+}} in Crash.exe at {{.*[\\/]}}Crash.swift:20:15
// FRIENDLY: 18| print("About to crash")
// FRIENDLY-NEXT: 19| let ptr = UnsafeMutablePointer<Int>(bitPattern: 4)!
// FRIENDLY-NEXT: 20| ptr.pointee = 42
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 21| }
// FRIENDLY-NEXT: 22|
// FRIENDLY: 1 level4() + {{[0-9]+}} in Crash.exe at {{.*[\\/]}}Crash.swift:14:3
// FRIENDLY: 12|
// FRIENDLY-NEXT: 13| func level4() {
// FRIENDLY-NEXT: 14| level5()
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 15| }
// FRIENDLY-NEXT: 16|
// FRIENDLY: 2 level3() + {{[0-9]+}} in Crash.exe at {{.*[\\/]}}Crash.swift:10:3
// FRIENDLY: 8|
// FRIENDLY-NEXT: 9| func level3() {
// FRIENDLY-NEXT: 10| level4()
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 11| }
// FRIENDLY-NEXT: 12|
// FRIENDLY: 3 level2() + {{[0-9]+}} in Crash.exe at {{.*[\\/]}}Crash.swift:6:3
// FRIENDLY: 4|
// FRIENDLY-NEXT: 5| func level2() {
// FRIENDLY-NEXT: 6| level3()
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 7| }
// FRIENDLY-NEXT: 8|
// FRIENDLY: 4 level1() + {{[0-9]+}} in Crash.exe at {{.*[\\/]}}Crash.swift:2:3
// FRIENDLY: 1| func level1() {
// FRIENDLY-NEXT: 2| level2()
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 3| }
// FRIENDLY: 5 static Crash.main() + {{[0-9]+}} in Crash.exe at {{.*[\\/]}}Crash.swift:26:5
// FRIENDLY: 24| struct Crash {
// FRIENDLY-NEXT: 25| static func main() {
// FRIENDLY-NEXT: 26| level1()
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 27| }
// FRIENDLY-NEXT: 28| }