mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 09:43:57 +00:00
d2ef2ce26f
Bug: https://github.com/dart-lang/sdk/issues/39487 Change-Id: I54d09341fa4b919e7efe9ea0714c089d2ee91826 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299880 Reviewed-by: Liam Appelbe <liama@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
28 lines
746 B
Dart
28 lines
746 B
Dart
// Copyright (c) 2023, 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.
|
|
|
|
// SharedObjects=ffi_test_functions
|
|
|
|
import "dart:ffi";
|
|
import "dart:isolate";
|
|
|
|
import "callback_tests_utils.dart";
|
|
|
|
typedef SimpleAdditionType = Int32 Function(Int32, Int32);
|
|
int simpleAddition(int x, int y) {
|
|
print("simpleAddition($x, $y)");
|
|
Isolate.current.kill(priority: Isolate.immediate);
|
|
return x + y;
|
|
}
|
|
|
|
final testcases = [
|
|
CallbackTest("SimpleAddition",
|
|
Pointer.fromFunction<SimpleAdditionType>(simpleAddition, 0)),
|
|
];
|
|
|
|
void main() {
|
|
testcases.forEach((t) => t.run());
|
|
throw "Should not be reached";
|
|
}
|