Files
sdk/runtime/tests/vm/dart/split_aot_kernel_generation_test.dart
T
Ryan Macnak fc750ac8e0 [build] Remove unsigned executable memory permissions from the AOT runtime on Mac.
Snapshots are now generally signed Mach-O dylibs loaded by dlopen, instead of ELF files mapped executable by the VM's loader.

TEST=ci
Change-Id: Id19877bed0bd0282b320f070904a848b0c076a54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505200
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-01 07:21:29 -07:00

55 lines
1.6 KiB
Dart

// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// OtherResources=gc/splay_test.dart gc/splay_common.dart
// Tests AOT kernel generation split into 2 steps using '--from-dill' option.
import 'dart:io' show Platform;
import 'package:path/path.dart' as path;
import 'snapshot_test_helper.dart';
Future<void> runSplitAOTKernelGenerationTest(Uri testScriptUri) async {
await withTempDir("split-test", (String temp) async {
final intermediateDillPath = path.join(temp, 'intermediate.dill');
final outputDillPath = path.join(temp, 'output.dill');
final snapshotPath = path.join(temp, 'aot.snapshot');
await runGenKernel('BUILD INTERMEDIATE DILL FILE', [
'--no-aot',
'--link-platform',
'--output=$intermediateDillPath',
testScriptUri.toFilePath(),
]);
await runGenKernel('BUILD FINAL DILL FILE', [
'--aot',
'--from-dill=$intermediateDillPath',
'--link-platform',
'--output=$outputDillPath',
testScriptUri.toFilePath(),
]);
await runGenSnapshot('GENERATE SNAPSHOT', [
if (Platform.isMacOS) ...[
'--snapshot-kind=app-aot-macho-dylib',
'--macho=$snapshotPath',
] else ...[
'--snapshot-kind=app-aot-elf',
'--elf=$snapshotPath',
],
outputDillPath,
]);
await runBinary('RUN SNAPSHOT', dartPrecompiledRuntime, [snapshotPath]);
});
}
main() async {
await runSplitAOTKernelGenerationTest(
Platform.script.resolve('gc/splay_test.dart'),
);
}