Files
Duo Wang 3c2519c0b8 [test][Backtracing] Make suite work under remote-run: %env- SWIFT_BACKTRACE, upload .dSYM (#90481)
This PR contains two independent fixes to make `test/Backtracing/` pass
when lit is driven through `remote-run`:
* Prefix `SWIFT_BACKTRACE` with `%env-` so it is forwarded to the remote
process under `remote-run`. Under `remote-run`, only variables matching
the `%env-` prefix substitution (expands to `REMOTE_RUN_CHILD_`) are
forwarded to the remote process.
* Add generated `.dSYM` bundles to the test command so they are rsync'd
by `remote-run` alongside test binaries. remote-run` only rsyncs paths
that appear on the command line.
2026-07-10 00:14:53 -07:00

35 lines
2.1 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: %empty-directory(%t/crashlogs)
// RUN: %target-build-swift %S/Inputs/Crash.swift -parse-as-library -Onone -g -o %t/CrashOutputFile.exe
// RUN: %target-codesign %t/CrashOutputFile.exe
// RUN: ! env %env-SWIFT_BACKTRACE=enable=yes,cache=no,output-to=%t/crash.log %target-run %t/CrashOutputFile.exe %t/CrashOutputFile.exe.dSYM 2>&1
// RUN: %FileCheck --ignore-case %s < %t/crash.log
// RUN: ! env %env-SWIFT_BACKTRACE=enable=yes,cache=no,output-to=%t/crashlogs %target-run %t/CrashOutputFile.exe %t/CrashOutputFile.exe.dSYM 2>&1
// RUN: cat %t/crashlogs/* | %FileCheck --ignore-case %s
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime
// UNSUPPORTED: asan
// REQUIRES: executable_test
// REQUIRES: backtracing
// REQUIRES: OS=macosx || OS=linux-gnu || OS=windows-msvc
// CHECK: *** Program crashed: {{(Bad pointer dereference|Access violation)}} at 0x{{0+}}4 ***
// CHECK: Thread 0 {{(".*" )?}}crashed:
// CHECK: 0 0x{{[0-9a-f]+}} level5() + {{[0-9]+}} in CrashOutputFile.exe at {{.*[\\/]}}Crash.swift:20:15
// CHECK-NEXT: 1 [ra] 0x{{[0-9a-f]+}} level4() + {{[0-9]+}} in CrashOutputFile.exe at {{.*[\\/]}}Crash.swift:14:3
// CHECK-NEXT: 2 [ra] 0x{{[0-9a-f]+}} level3() + {{[0-9]+}} in CrashOutputFile.exe at {{.*[\\/]}}Crash.swift:10:3
// CHECK-NEXT: 3 [ra] 0x{{[0-9a-f]+}} level2() + {{[0-9]+}} in CrashOutputFile.exe at {{.*[\\/]}}Crash.swift:6:3
// CHECK-NEXT: 4 [ra] 0x{{[0-9a-f]+}} level1() + {{[0-9]+}} in CrashOutputFile.exe at {{.*[\\/]}}Crash.swift:2:3
// CHECK-NEXT: 5 [ra] 0x{{[0-9a-f]+}} static Crash.main() + {{[0-9]+}} in CrashOutputFile.exe at {{.*[\\/]}}Crash.swift:26:5
// CHECK-NEXT: 6 [ra] [system] 0x{{[0-9a-f]+}} static Crash.$main() + {{[0-9]+}} in CrashOutputFile.exe at {{.*[\\/]}}<compiler-generated>
// CHECK-NEXT: 7 [ra] [system] 0x{{[0-9a-f]+}} main + {{[0-9]+}} in CrashOutputFile.exe at {{.*[\\/]}}Crash.swift
// CHECK: Registers:
// CHECK: Images ({{[0-9]+}} omitted):
// CHECK: {{0x[0-9a-f]+}}–{{0x[0-9a-f]+}}{{ +}}{{([0-9a-f]+|<no build ID>)}}{{ +}}CrashOutputFile.exe{{ +}}{{.*[\\/]}}CrashOutputFile.exe