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

63 lines
2.0 KiB
Plaintext

// RUN: %empty-directory(%t)
// RUN: %target-build-swift %S/../Inputs/Overflow.swift -parse-as-library -Onone %swift-debug-flags -o %t/Overflow.exe
// RUN: %target-codesign %t/Overflow.exe
// RUN: ! env %env-SWIFT_BACKTRACE=preset=friendly,enable=yes,cache=no %target-run %t/Overflow.exe %t/Overflow.exe.dSYM > %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: remote_run
// REQUIRES: executable_test
// REQUIRES: backtracing
// REQUIRES: OS=macosx || OS=linux-gnu || OS=windows-msvc
// FRIENDLY: *** Swift runtime failure: arithmetic overflow ***
// FRIENDLY: Thread 0 {{(".*" )?}}crashed:
// FRIENDLY: 0 level5() + {{[0-9]+}} in Overflow.exe at {{.*[\\/]}}Overflow.swift:22:5
// FRIENDLY: 20| print("About to overflow")
// FRIENDLY-NEXT: 21|
// FRIENDLY-NEXT: 22| x -= 1
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 23| }
// FRIENDLY: 1 level4() + {{[0-9]+}} in Overflow.exe at {{.*[\\/]}}Overflow.swift:16:3
// FRIENDLY: 14|
// FRIENDLY-NEXT: 15| func level4() {
// FRIENDLY-NEXT: 16| level5()
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 17| }
// FRIENDLY-NEXT: 18|
// FRIENDLY: 2 level3() + {{[0-9]+}} in Overflow.exe at {{.*[\\/]}}Overflow.swift:12:3
// FRIENDLY: 10|
// FRIENDLY-NEXT: 11| func level3() {
// FRIENDLY-NEXT: 12| level4()
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 13| }
// FRIENDLY-NEXT: 14|
// FRIENDLY: 3 level2() + {{[0-9]+}} in Overflow.exe at {{.*[\\/]}}Overflow.swift:8:3
// FRIENDLY: 6|
// FRIENDLY-NEXT: 7| func level2() {
// FRIENDLY-NEXT: 8| level3()
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 9| }
// FRIENDLY-NEXT: 10|
// FRIENDLY: 4 level1() + {{[0-9]+}} in Overflow.exe at {{.*[\\/]}}Overflow.swift:4:3
// FRIENDLY: 2|
// FRIENDLY-NEXT: 3| func level1() {
// FRIENDLY-NEXT: 4| level2()
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 5| }
// FRIENDLY-NEXT: 6|
// FRIENDLY: 5 static Overflow.main() + {{[0-9]+}} in Overflow.exe at {{.*[\\/]}}Overflow.swift