[pkg/test_runner] Only use .dll for assembled snapshots on Windows.
Use "out.aotsnapshot" as the name for all non-assembled snapshots and
names with the appropriate shared object extension for the host OS for
assembled snapshots.
This ensures the test checks for .dll extensions added in
https://dart-review.googlesource.com/c/sdk/+/428200 only trigger
for assembled snapshots as expected, and not for other formats
(e.g., Windows trybots using sanitizers, which still use direct
to ELF snapshots).
Also fixes incorrect line numbers in dwarf_stack_trace_test.dart.
TEST=vm/dart/build_id_test
standalone/dwarf_stack_trace_test
Cq-Include-Trybots: luci.dart.try:vm-asan-win-release-x64-try,vm-linux-release-x64-try,vm-mac-release-arm64-try
Bug: https://github.com/dart-lang/sdk/issues/60846
Change-Id: Ife06613d86874d76adeb99dcbc50fc3723aae584
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432660
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
diff --git a/pkg/test_runner/lib/src/compiler_configuration.dart b/pkg/test_runner/lib/src/compiler_configuration.dart
index 3e6c707..7931c5d 100644
--- a/pkg/test_runner/lib/src/compiler_configuration.dart
+++ b/pkg/test_runner/lib/src/compiler_configuration.dart
@@ -1409,15 +1409,17 @@
String tempAssemblyFile(String tempDir) =>
Path('$tempDir/out.S').toNativePath();
String tempAOTFile(String tempDir) {
- switch (_configuration.system) {
- case System.android:
- case System.fuchsia:
- case System.linux:
- return Path('$tempDir/libout.so').toNativePath();
- case System.mac:
- return Path('$tempDir/libout.dylib').toNativePath();
- case System.win:
- return Path('$tempDir/out.dll').toNativePath();
+ if (_configuration.genSnapshotFormat == GenSnapshotFormat.assembly) {
+ switch (_configuration.system) {
+ case System.android:
+ case System.fuchsia:
+ case System.linux:
+ return Path('$tempDir/libout.so').toNativePath();
+ case System.mac:
+ return Path('$tempDir/libout.dylib').toNativePath();
+ case System.win:
+ return Path('$tempDir/out.dll').toNativePath();
+ }
}
return Path('$tempDir/out.aotsnapshot').toNativePath();
}
diff --git a/tests/standalone/dwarf_stack_trace_test.dart b/tests/standalone/dwarf_stack_trace_test.dart
index 4d0e66b..9aa834d 100644
--- a/tests/standalone/dwarf_stack_trace_test.dart
+++ b/tests/standalone/dwarf_stack_trace_test.dart
@@ -211,14 +211,14 @@
DartCallInfo(
function: "bar",
filename: "dwarf_stack_trace_test.dart",
- line: 17,
+ line: 18,
column: 3,
inlined: true,
),
DartCallInfo(
function: "foo",
filename: "dwarf_stack_trace_test.dart",
- line: 23,
+ line: 24,
column: 3,
inlined: false,
),
@@ -228,7 +228,7 @@
DartCallInfo(
function: "main",
filename: "dwarf_stack_trace_test.dart",
- line: 29,
+ line: 30,
column: 5,
inlined: false,
),