Files
swift-mirror/test/Backtracing/CrashNoDebug.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

53 lines
2.3 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 -Onone -o %t/CrashNoDebug.exe
// RUN: %target-build-swift %S/Inputs/Crash.swift -parse-as-library -O -o %t/CrashOptNoDebug.exe
// RUN: %target-codesign %t/CrashNoDebug.exe
// RUN: %target-codesign %t/CrashOptNoDebug.exe
// RUN: env SWIFT_BACKTRACE=enable=yes,cache=no %target-run %t/CrashNoDebug.exe > %t/NoDebug.out 2>&1 || true
// RUN: %FileCheck %s --ignore-case --check-prefix NODEBUG < %t/NoDebug.out
// RUN: env SWIFT_BACKTRACE=enable=yes,cache=no %target-run %t/CrashOptNoDebug.exe > %t/OptNoDebug.out 2>&1 || true
// RUN: %FileCheck %s --ignore-case --check-prefix OPTNODEBUG < %t/OptNoDebug.out
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime
// UNSUPPORTED: asan
// REQUIRES: executable_test
// REQUIRES: backtracing
// REQUIRES: OS=macosx || OS=linux-gnu
// NODEBUG: *** Program crashed: {{(Bad pointer dereference|Access violation)}} at 0x{{0*}}4 ***
// NODEBUG: Thread 0 {{(".*" )?}}crashed:
// NODEBUG: 0 0x{{[0-9a-f]+}} level5() + {{[0-9]+}} in CrashNoDebug.exe
// NODEBUG: 1 [ra] 0x{{[0-9a-f]+}} level4() + {{[0-9]+}} in CrashNoDebug.exe
// NODEBUG: 2 [ra] 0x{{[0-9a-f]+}} level3() + {{[0-9]+}} in CrashNoDebug.exe
// NODEBUG: 3 [ra] 0x{{[0-9a-f]+}} level2() + {{[0-9]+}} in CrashNoDebug.exe
// NODEBUG: 4 [ra] 0x{{[0-9a-f]+}} level1() + {{[0-9]+}} in CrashNoDebug.exe
// NODEBUG: 5 [ra] 0x{{[0-9a-f]+}} static Crash.main() + {{[0-9]+}} in CrashNoDebug.exe
// NODEBUG: 6 [ra] [system] 0x{{[0-9a-f]+}} static Crash.$main() + {{[0-9]+}} in CrashNoDebug.exe
// NODEBUG: 7 [ra] 0x{{[0-9a-f]+}} main + {{[0-9]+}} in CrashNoDebug.exe
// NODEBUG: Registers:
// NODEBUG: Images ({{[0-9]+}} omitted):
// NODEBUG: {{0x[0-9a-f]+}}{{0x[0-9a-f]+}}{{ +}}{{([0-9a-f]+|<no build ID>)}}{{ +}}CrashNoDebug.exe{{ +}}{{.*[\\/]}}CrashNoDebug.exe
// OPTNODEBUG: *** Program crashed: {{(Bad pointer dereference|Access violation)}} at 0x{{0*}}4 ***
// OPTNODEBUG: Thread 0 {{(".*" )?}}crashed:
// OPTNODEBUG: 0 0x{{[0-9a-f]+}} main + {{[0-9]+}} in CrashOptNoDebug.exe
// OPTNODEBUG: Registers:
// OPTNODEBUG: Images ({{[0-9]+}} omitted):
// OPTNODEBUG: {{0x[0-9a-f]+}}{{0x[0-9a-f]+}}{{ +}}{{([0-9a-f]+|<no build ID>)}}{{ +}}CrashOptNoDebug.exe{{ +}}{{.*[\\/]}}CrashOptNoDebug.exe