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

36 lines
1.4 KiB
Plaintext

// RUN: %empty-directory(%t)
// RUN: %target-build-swift %S/../Inputs/CrashWithThunk.swift -parse-as-library -Onone %swift-debug-flags -o %t/CrashWithThunk.exe
// RUN: %target-codesign %t/CrashWithThunk.exe
// RUN: ! env %env-SWIFT_BACKTRACE=preset=friendly,enable=yes,cache=no %target-run %t/CrashWithThunk.exe %t/CrashWithThunk.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: 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 crash() + {{[0-9]+}} in CrashWithThunk.exe at {{.*[\\/]}}CrashWithThunk.swift:8:15
// FRIENDLY: 6| print("I'm going to crash here")
// FRIENDLY-NEXT: 7| let ptr = UnsafeMutablePointer<Int>(bitPattern: 4)!
// FRIENDLY-NEXT: 8| ptr.pointee = 42
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 9| }
// FRIENDLY-NEXT: 10|
// FRIENDLY: 1 static CrashWithThunk.main() + {{[0-9]+}} in CrashWithThunk.exe at {{.*[\\/]}}CrashWithThunk.swift:16:9
// FRIENDLY: 14| let foo = Foo(value: crash)
// FRIENDLY-NEXT: 15|
// FRIENDLY-NEXT: 16| foo.value()
// FRIENDLY-NEXT: | ^
// FRIENDLY-NEXT: 17| }
// FRIENDLY-NEXT: 18| }