dart-sdk/tests/ffi_2/regress_46127_test.dart
Alexander Thomas 7baeabe0e4 [testing] Rely on language versions in the analyzer tests
https://github.com/dart-lang/co19/issues/1090

TEST=Standard tryjobs, all changes are in test code only.

Change-Id: Ie73174447ab165827335652cf035f85b7510ab55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201564
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2021-06-02 07:47:46 +00:00

28 lines
658 B
Dart

// Copyright (c) 2021, 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.
// @dart = 2.9
// SharedObjects=ffi_test_functions
import 'dart:ffi';
import "package:expect/expect.dart";
import 'dylib_utils.dart';
final nativeLib = dlopenPlatformSpecific("ffi_test_functions");
class Struct46127 extends Struct {
@Uint64()
int val;
}
void main() {
final struct =
nativeLib.lookupFunction<Struct46127 Function(), Struct46127 Function()>(
'Regress46127')();
Expect.equals(123, struct.val);
}