mirror of
https://github.com/apple/swift.git
synced 2026-10-12 14:50:47 +02:00
60 lines
2.4 KiB
Plaintext
60 lines
2.4 KiB
Plaintext
// RUN: %empty-directory(%t)
|
|
// RUN: %target-build-swift %S/../Inputs/CrashAsync.swift -parse-as-library -Onone -g -o %t/CrashAsync
|
|
// RUN: %target-codesign %t/CrashAsync
|
|
|
|
// Demangling is disabled for now because older macOS can't demangle async
|
|
// function names. We test demangling elsewhere, so this is no big deal.
|
|
|
|
// RUN: not --crash env %env-SWIFT_BACKTRACE=preset=friendly,enable=yes,demangle=no,cache=no %target-run %t/CrashAsync 2>&1 | %FileCheck %s --check-prefix FRIENDLY -dump-input-filter=all
|
|
|
|
// UNSUPPORTED: use_os_stdlib
|
|
// UNSUPPORTED: back_deployment_runtime
|
|
// UNSUPPORTED: asan
|
|
// UNSUPPORTED: remote_run
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: backtracing
|
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
|
|
|
// FRIENDLY: *** Program crashed: Bad pointer dereference at 0x{{0+}}4 ***
|
|
|
|
// FRIENDLY: Thread {{[0-9]+( ".*")?}} crashed:
|
|
|
|
// FRIENDLY: 0 {{_?}}$s10CrashAsync5crashyyF + {{[0-9]+}} in CrashAsync at {{.*}}CrashAsync.swift:4:15
|
|
|
|
// FRIENDLY: 2| func crash() {
|
|
// FRIENDLY-NEXT: 3| let ptr = UnsafeMutablePointer<Int>(bitPattern: 4)!
|
|
// FRIENDLY-NEXT: * 4| ptr.pointee = 42
|
|
// FRIENDLY-NEXT: | ^
|
|
// FRIENDLY-NEXT: 5| }
|
|
// FRIENDLY-NEXT: 6|
|
|
|
|
// FRIENDLY: 1 {{_?}}$s10CrashAsync5levelyySiYaFTY0_ + {{[0-9]+}} in CrashAsync at {{.*}}CrashAsync.swift:12:5
|
|
|
|
// FRIENDLY: 10| await level(n + 1)
|
|
// FRIENDLY-NEXT: 11| } else {
|
|
// FRIENDLY-NEXT: * 12| crash()
|
|
// FRIENDLY-NEXT: | ^
|
|
// FRIENDLY-NEXT: 13| }
|
|
// FRIENDLY-NEXT: 14| }
|
|
|
|
// FRIENDLY:2 {{_?}}$s10CrashAsync5levelyySiYaFTQ1_ in CrashAsync at {{.*}}CrashAsync.swift:10
|
|
|
|
// FRIENDLY: 8| func level(_ n: Int) async {
|
|
// FRIENDLY-NEXT: 9| if n < 5 {
|
|
// FRIENDLY-NEXT: * 10| await level(n + 1)
|
|
// FRIENDLY-NEXT: | ^
|
|
// FRIENDLY-NEXT: 11| } else {
|
|
// FRIENDLY-NEXT: 12| crash()
|
|
|
|
// FRIENDLY: 3 {{_?}}$s10CrashAsync5levelyySiYaFTQ1_ in CrashAsync at {{.*}}CrashAsync.swift:10
|
|
// FRIENDLY: 4 {{_?}}$s10CrashAsync5levelyySiYaFTQ1_ in CrashAsync at {{.*}}CrashAsync.swift:10
|
|
// FRIENDLY: 5 {{_?}}$s10CrashAsync5levelyySiYaFTQ1_ in CrashAsync at {{.*}}CrashAsync.swift:10
|
|
// FRIENDLY: 6 {{_?}}$s10CrashAsyncAAV4mainyyYaFZ{{TQ0_| \+ [0-9]+}} in CrashAsync at {{.*}}CrashAsync.swift:20
|
|
|
|
// FRIENDLY: 18| struct CrashAsync {
|
|
// FRIENDLY-NEXT: 19| static func main() async {
|
|
// FRIENDLY-NEXT: * 20| await level(1)
|
|
// FRIENDLY-NEXT: | ^
|
|
// FRIENDLY-NEXT: 21| }
|
|
// FRIENDLY-NEXT: 22| }
|