Files
swift-mirror/test/Backtracing/CrashOpt.test
Alastair Houghton 6d930d39ec [Backtracing] Make tests work, plus various fixes.
Made the tests run, then fixed various issues with them.

rdar://101623384
2026-02-03 18:23:29 +00:00

33 lines
1.7 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %S/Inputs/Crash.swift -parse-as-library -O %swift-debug-flags -o %t/CrashOpt.exe
// RUN: %target-codesign %t/CrashOpt.exe
// RUN: env SWIFT_BACKTRACE=enable=yes,cache=no %target-run %t/CrashOpt.exe > %t/Optimized.out 2>&1 || true
// RUN: %FileCheck %s --ignore-case --check-prefix OPTIMIZED < %t/Optimized.out
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime
// UNSUPPORTED: asan
// REQUIRES: executable_test
// REQUIRES: backtracing
// REQUIRES: OS=macosx || OS=linux-gnu
// CHECK: *** Program crashed: {{(Bad // OPTIMIZED: *** Program crashed: {{(Bad pointer dereference|Access violation)}} at 0x{{0+}}4 ***
// OPTIMIZED: Thread 0 {{(".*" )?}}crashed:
// OPTIMIZED: 0 [inlined] 0x{{[0-9a-f]+}} level5() in CrashOpt.exe at {{.*[\\/]}}Crash.swift:20:15
// OPTIMIZED-NEXT: 1 [inlined] 0x{{[0-9a-f]+}} level4() in CrashOpt.exe at {{.*[\\/]}}Crash.swift:14:3
// OPTIMIZED-NEXT: 2 [inlined] 0x{{[0-9a-f]+}} level3() in CrashOpt.exe at {{.*[\\/]}}Crash.swift:10:3
// OPTIMIZED-NEXT: 3 [inlined] 0x{{[0-9a-f]+}} level2() in CrashOpt.exe at {{.*[\\/]}}Crash.swift:6:3
// OPTIMIZED-NEXT: 4 [inlined] 0x{{[0-9a-f]+}} level1() in CrashOpt.exe at {{.*[\\/]}}Crash.swift:2:3
// OPTIMIZED-NEXT: 5 [inlined] 0x{{[0-9a-f]+}} static Crash.main() in CrashOpt.exe at {{.*[\\/]}}Crash.swift:26:5
// OPTIMIZED: {{6|7}} [system] 0x{{[0-9a-f]+}} main + {{[0-9]+}} in CrashOpt.exe at {{.*}}
// OPTIMIZED: Registers:
// OPTIMIZED: Images ({{[0-9]+}} omitted):
// OPTIMIZED: {{0x[0-9a-f]+}}{{0x[0-9a-f]+}}{{ +}}{{([0-9a-f]+|<no build ID>)}}{{ +}}CrashOpt.exe{{ +}}{{.*[\\/]}}CrashOpt.exe