mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:07:49 +00:00
[vm/ffi] Fix test sizeOf
struct on arm32
Bug introduced in https://dart-review.googlesource.com/c/sdk/+/182262. See documentation on alignment in the following places: - pkg/vm/lib/transformations/ffi.dart - runtime/vm/compiler/ffi/abi.cc - runtime/vm/compiler/ffi/native_type.cc Closes: https://github.com/dart-lang/sdk/issues/44835 Change-Id: I114dd4286e559bb230e1ee27ae5cfd8a0b0d2927 Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182501 Commit-Queue: Daco Harkes <dacoharkes@google.com> Reviewed-by: Clement Skau <cskau@google.com>
This commit is contained in:
parent
f306f4c4d4
commit
ae4631e100
|
@ -16,9 +16,10 @@ get is64Bit => 8 == sizeOf<IntPtr>();
|
||||||
void main() async {
|
void main() async {
|
||||||
if (is32Bit) {
|
if (is32Bit) {
|
||||||
Expect.equals(4, sizeOf<Pointer>());
|
Expect.equals(4, sizeOf<Pointer>());
|
||||||
Expect.equals(20, sizeOf<Coordinate>());
|
// Struct is 20 bytes on ia32 and arm32-iOS, but 24 bytes on arm32-Android
|
||||||
}
|
// and arm32-Linux due to alignment.
|
||||||
if (is64Bit) {
|
Expect.isTrue(20 == sizeOf<Coordinate>() || 24 == sizeOf<Coordinate>());
|
||||||
|
} else if (is64Bit) {
|
||||||
Expect.equals(8, sizeOf<Pointer>());
|
Expect.equals(8, sizeOf<Pointer>());
|
||||||
Expect.equals(24, sizeOf<Coordinate>());
|
Expect.equals(24, sizeOf<Coordinate>());
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,10 @@ get is64Bit => 8 == sizeOf<IntPtr>();
|
||||||
void main() async {
|
void main() async {
|
||||||
if (is32Bit) {
|
if (is32Bit) {
|
||||||
Expect.equals(4, sizeOf<Pointer>());
|
Expect.equals(4, sizeOf<Pointer>());
|
||||||
Expect.equals(20, sizeOf<Coordinate>());
|
// Struct is 20 bytes on ia32 and arm32-iOS, but 24 bytes on arm32-Android
|
||||||
}
|
// and arm32-Linux due to alignment.
|
||||||
if (is64Bit) {
|
Expect.isTrue(20 == sizeOf<Coordinate>() || 24 == sizeOf<Coordinate>());
|
||||||
|
} else if (is64Bit) {
|
||||||
Expect.equals(8, sizeOf<Pointer>());
|
Expect.equals(8, sizeOf<Pointer>());
|
||||||
Expect.equals(24, sizeOf<Coordinate>());
|
Expect.equals(24, sizeOf<Coordinate>());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue