[vm, ffi] Add Windows ARM64 to FFI unit tests.

This accepts the current results, including known bugs in handling of variadic arguments. Fixes are in a follow-up CL.

TEST=ci
Change-Id: I6a0bd11aeb1fe0a6980dd6ff974dc5a4b207fb97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329824
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
diff --git a/pkg/test_runner/lib/src/test_suite.dart b/pkg/test_runner/lib/src/test_suite.dart
index cb7a61f..793e6a9 100644
--- a/pkg/test_runner/lib/src/test_suite.dart
+++ b/pkg/test_runner/lib/src/test_suite.dart
@@ -400,6 +400,7 @@
     "arm64_ios",
     "arm64_linux",
     "arm64_macos",
+    "arm64_win",
     "arm_android",
     "arm_ios",
     "arm_linux",
diff --git a/runtime/bin/ffi_unit_test/BUILD.gn b/runtime/bin/ffi_unit_test/BUILD.gn
index c06d9e5..430b908 100644
--- a/runtime/bin/ffi_unit_test/BUILD.gn
+++ b/runtime/bin/ffi_unit_test/BUILD.gn
@@ -137,6 +137,13 @@
   ]
 }
 
+build_run_ffi_unit_tests("run_ffi_unit_tests_arm64_win") {
+  extra_configs = [
+    ":define_target_arch_arm64",
+    ":define_target_os_windows",
+  ]
+}
+
 build_run_ffi_unit_tests("run_ffi_unit_tests_ia32_android") {
   extra_configs = [
     ":define_target_arch_ia32",
@@ -214,6 +221,7 @@
     ":run_ffi_unit_tests_arm64_ios",  # No other test coverage.
     ":run_ffi_unit_tests_arm64_linux",
     ":run_ffi_unit_tests_arm64_macos",
+    ":run_ffi_unit_tests_arm64_win",
     ":run_ffi_unit_tests_arm_android",  # SoftFP
     ":run_ffi_unit_tests_arm_ios",  # No other test coverage.
     ":run_ffi_unit_tests_arm_linux",  # HardFP
diff --git a/runtime/vm/compiler/ffi/unit_tests/doublex20/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/doublex20/arm64_win.expect
new file mode 100644
index 0000000..3b73df0
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/doublex20/arm64_win.expect
@@ -0,0 +1,22 @@
+v0 double
+v1 double
+v2 double
+v3 double
+v4 double
+v5 double
+v6 double
+v7 double
+S+0 double
+S+8 double
+S+16 double
+S+24 double
+S+32 double
+S+40 double
+S+48 double
+S+56 double
+S+64 double
+S+72 double
+S+80 double
+S+88 double
+=>
+v0 double
diff --git a/runtime/vm/compiler/ffi/unit_tests/floatx20/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/floatx20/arm64_win.expect
new file mode 100644
index 0000000..7964f7b
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/floatx20/arm64_win.expect
@@ -0,0 +1,22 @@
+v0 float
+v1 float
+v2 float
+v3 float
+v4 float
+v5 float
+v6 float
+v7 float
+S+0 float
+S+8 float
+S+16 float
+S+24 float
+S+32 float
+S+40 float
+S+48 float
+S+56 float
+S+64 float
+S+72 float
+S+80 float
+S+88 float
+=>
+v0 float
diff --git a/runtime/vm/compiler/ffi/unit_tests/int8x10/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/int8x10/arm64_win.expect
new file mode 100644
index 0000000..04f72e5f
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/int8x10/arm64_win.expect
@@ -0,0 +1,12 @@
+r0 int8
+r1 int8
+r2 int8
+r3 int8
+r4 int8
+r5 int8
+r6 int8
+r7 int8
+S+0 int8
+S+8 int8
+=>
+r0 int8
diff --git a/runtime/vm/compiler/ffi/unit_tests/mixedx20/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/mixedx20/arm64_win.expect
new file mode 100644
index 0000000..32318c2
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/mixedx20/arm64_win.expect
@@ -0,0 +1,22 @@
+r0 int64
+v0 float
+r1 int64
+v1 double
+r2 int64
+v2 float
+r3 int64
+v3 double
+r4 int64
+v4 float
+r5 int64
+v5 double
+r6 int64
+v6 float
+r7 int64
+v7 double
+S+0 int64
+S+8 float
+S+16 int64
+S+24 double
+=>
+v0 double
diff --git a/runtime/vm/compiler/ffi/unit_tests/regress46127/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/regress46127/arm64_win.expect
new file mode 100644
index 0000000..9245d0d
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/regress46127/arm64_win.expect
@@ -0,0 +1,3 @@
+
+=>
+M(r0 int64) Struct(size: 8)
diff --git a/runtime/vm/compiler/ffi/unit_tests/regress49460/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/regress49460/arm64_win.expect
new file mode 100644
index 0000000..e914cc9
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/regress49460/arm64_win.expect
@@ -0,0 +1,5 @@
+r0 int32
+r1 int64
+r2 int64
+=>
+r0 int32
diff --git a/runtime/vm/compiler/ffi/unit_tests/regress_fuchsia105336/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/regress_fuchsia105336/arm64_win.expect
new file mode 100644
index 0000000..ea3fdac
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/regress_fuchsia105336/arm64_win.expect
@@ -0,0 +1,9 @@
+r0 int64
+v0 double
+r1 int32
+v1 double
+r2 int32
+r3 int64
+r4 int64
+=>
+r0 void
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct128bytesx1/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct128bytesx1/arm64_win.expect
new file mode 100644
index 0000000..19a9509
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct128bytesx1/arm64_win.expect
@@ -0,0 +1,4 @@
+P(r0 int64) Struct(size: 128)
+r1 int32
+=>
+P(r8 int64) Struct(size: 128)
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct12bytesFloatx6/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct12bytesFloatx6/arm64_win.expect
new file mode 100644
index 0000000..e14f6b1
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct12bytesFloatx6/arm64_win.expect
@@ -0,0 +1,8 @@
+M(v0 float, v1 float, v2 float) Struct(size: 12)
+M(v3 float, v4 float, v5 float) Struct(size: 12)
+S+0 Struct(size: 12)
+S+16 Struct(size: 12)
+S+32 Struct(size: 12)
+S+48 Struct(size: 12)
+=>
+r0 int64
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct16bytesHomogenousx10/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct16bytesHomogenousx10/arm64_win.expect
new file mode 100644
index 0000000..123cea6
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct16bytesHomogenousx10/arm64_win.expect
@@ -0,0 +1,15 @@
+M(v0 float, v1 float, v2 float, v3 float) Struct(size: 16)
+v4 float
+S+0 Struct(size: 16)
+S+16 Struct(size: 16)
+S+32 Struct(size: 16)
+S+48 Struct(size: 16)
+S+64 Struct(size: 16)
+S+80 Struct(size: 16)
+S+96 Struct(size: 16)
+S+112 Struct(size: 16)
+S+128 float
+r0 int8
+S+136 Struct(size: 16)
+=>
+M(v0 float, v1 float, v2 float, v3 float) Struct(size: 16)
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct3bytesx10/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct3bytesx10/arm64_win.expect
new file mode 100644
index 0000000..0eb0d54
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct3bytesx10/arm64_win.expect
@@ -0,0 +1,12 @@
+M(r0 int64) Struct(size: 3)
+M(r1 int64) Struct(size: 3)
+M(r2 int64) Struct(size: 3)
+M(r3 int64) Struct(size: 3)
+M(r4 int64) Struct(size: 3)
+M(r5 int64) Struct(size: 3)
+M(r6 int64) Struct(size: 3)
+M(r7 int64) Struct(size: 3)
+M(S+0 int64) Struct(size: 3)
+M(S+8 int64) Struct(size: 3)
+=>
+M(r0 int64) Struct(size: 3)
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/arm64_win.expect
new file mode 100644
index 0000000..0857db5
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/arm64_win.expect
@@ -0,0 +1,12 @@
+M(r0 int64) Struct(size: 8)
+M(r1 int64) Struct(size: 8)
+M(r2 int64) Struct(size: 8)
+M(r3 int64) Struct(size: 8)
+M(r4 int64) Struct(size: 8)
+M(r5 int64) Struct(size: 8)
+M(r6 int64) Struct(size: 8)
+M(r7 int64) Struct(size: 8)
+S+0 Struct(size: 8)
+S+8 Struct(size: 8)
+=>
+M(r0 int64) Struct(size: 8)
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct8bytesx1/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct8bytesx1/arm64_win.expect
new file mode 100644
index 0000000..a6404ed
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct8bytesx1/arm64_win.expect
@@ -0,0 +1,3 @@
+M(r0 int64) Struct(size: 8)
+=>
+M(r0 int64) Struct(size: 8)
diff --git a/runtime/vm/compiler/ffi/unit_tests/structPacked/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/structPacked/arm64_win.expect
new file mode 100644
index 0000000..9653167
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/structPacked/arm64_win.expect
@@ -0,0 +1,15 @@
+M(r0 int64, r1 int64) Struct(size: 9)
+M(r2 int64, r3 int64) Struct(size: 9)
+M(r4 int64, r5 int64) Struct(size: 9)
+M(r6 int64, r7 int64) Struct(size: 9)
+S+0 Struct(size: 9)
+S+16 Struct(size: 9)
+S+32 Struct(size: 9)
+S+48 Struct(size: 9)
+S+64 Struct(size: 9)
+S+80 Struct(size: 9)
+v0 double
+S+96 int32
+S+104 int32
+=>
+v0 double
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct_VeryLargeStruct/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct_VeryLargeStruct/arm64_win.expect
new file mode 100644
index 0000000..59f05bb1
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct_VeryLargeStruct/arm64_win.expect
@@ -0,0 +1,17 @@
+Struct(size: 88, field alignment: 8, stack alignment: 8, members: {
+  0: int8,
+  2: int16,
+  4: int32,
+  8: int64,
+  16: uint8,
+  18: uint16,
+  20: uint32,
+  24: uint64,
+  32: int64,
+  40: double,
+  48: float,
+  56: int64,
+  64: int64,
+  72: int64,
+  80: int8
+})
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct_floatarray/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct_floatarray/arm64_win.expect
new file mode 100644
index 0000000..728e016
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct_floatarray/arm64_win.expect
@@ -0,0 +1,3 @@
+Struct(size: 16, field alignment: 4, stack alignment: 8, members: {
+  0: Array(element type: Struct(size: 8, field alignment: 4, stack alignment: 8, members: {0: Array(element type: float, length: 2)}), length: 2)
+})
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct_floatx4/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct_floatx4/arm64_win.expect
new file mode 100644
index 0000000..c065867
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct_floatx4/arm64_win.expect
@@ -0,0 +1,6 @@
+Struct(size: 16, field alignment: 4, stack alignment: 8, members: {
+  0: float,
+  4: float,
+  8: float,
+  12: float
+})
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct_int8array/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct_int8array/arm64_win.expect
new file mode 100644
index 0000000..02a0124
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct_int8array/arm64_win.expect
@@ -0,0 +1,3 @@
+Struct(size: 8, field alignment: 1, stack alignment: 8, members: {
+  0: Array(element type: int8, length: 8)
+})
diff --git a/runtime/vm/compiler/ffi/unit_tests/struct_int8x10/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/struct_int8x10/arm64_win.expect
new file mode 100644
index 0000000..e2ae57e
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/struct_int8x10/arm64_win.expect
@@ -0,0 +1,12 @@
+Struct(size: 10, field alignment: 1, stack alignment: 8, members: {
+  0: int8,
+  1: int8,
+  2: int8,
+  3: int8,
+  4: int8,
+  5: int8,
+  6: int8,
+  7: int8,
+  8: int8,
+  9: int8
+})
diff --git a/runtime/vm/compiler/ffi/unit_tests/union16bytesHomogenousx10/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/union16bytesHomogenousx10/arm64_win.expect
new file mode 100644
index 0000000..c2dcf8c
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/union16bytesHomogenousx10/arm64_win.expect
@@ -0,0 +1,13 @@
+M(v0 float, v1 float, v2 float, v3 float) Union(size: 16)
+M(v4 float, v5 float, v6 float, v7 float) Union(size: 16)
+S+0 Union(size: 16)
+S+16 Union(size: 16)
+S+32 Union(size: 16)
+S+48 Union(size: 16)
+S+64 Union(size: 16)
+S+80 Union(size: 16)
+S+96 Union(size: 16)
+r0 int8
+S+112 Union(size: 16)
+=>
+M(v0 float, v1 float, v2 float, v3 float) Union(size: 16)
diff --git a/runtime/vm/compiler/ffi/unit_tests/union5bytesPackedx10/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/union5bytesPackedx10/arm64_win.expect
new file mode 100644
index 0000000..5e76e36
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/union5bytesPackedx10/arm64_win.expect
@@ -0,0 +1,12 @@
+M(r0 int64) Union(size: 5)
+M(r1 int64) Union(size: 5)
+M(r2 int64) Union(size: 5)
+M(r3 int64) Union(size: 5)
+M(r4 int64) Union(size: 5)
+M(r5 int64) Union(size: 5)
+M(r6 int64) Union(size: 5)
+M(r7 int64) Union(size: 5)
+M(S+0 int64) Union(size: 5)
+M(S+8 int64) Union(size: 5)
+=>
+M(r0 int64) Union(size: 5)
diff --git a/runtime/vm/compiler/ffi/unit_tests/variadic_double/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/variadic_double/arm64_win.expect
new file mode 100644
index 0000000..8c90f11
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/variadic_double/arm64_win.expect
@@ -0,0 +1,7 @@
+v0 double
+v1 double
+v2 double
+v3 double
+v4 double
+=>
+v0 double
diff --git a/runtime/vm/compiler/ffi/unit_tests/variadic_int/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/variadic_int/arm64_win.expect
new file mode 100644
index 0000000..31cc186
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/variadic_int/arm64_win.expect
@@ -0,0 +1,7 @@
+r0 int64
+r1 int64
+r2 int64
+r3 int64
+r4 int64
+=>
+r0 int64
diff --git a/runtime/vm/compiler/ffi/unit_tests/variadic_register_alignment/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/variadic_register_alignment/arm64_win.expect
new file mode 100644
index 0000000..f01e76c
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/variadic_register_alignment/arm64_win.expect
@@ -0,0 +1,6 @@
+v0 double
+v1 double
+M(v2 double, v3 double, v4 double, v5 double) Struct(size: 32)
+v6 double
+=>
+v0 double
diff --git a/runtime/vm/compiler/ffi/unit_tests/variadic_with_homogenous_struct/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/variadic_with_homogenous_struct/arm64_win.expect
new file mode 100644
index 0000000..50f6c42
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/variadic_with_homogenous_struct/arm64_win.expect
@@ -0,0 +1,15 @@
+v0 double
+v1 double
+v2 double
+v3 double
+v4 double
+v5 double
+v6 double
+v7 double
+S+0 float
+S+8 Struct(size: 12)
+r0 int64
+r1 int32
+S+24 Struct(size: 12)
+=>
+v0 double
diff --git a/runtime/vm/compiler/ffi/unit_tests/variadic_with_struct/arm64_win.expect b/runtime/vm/compiler/ffi/unit_tests/variadic_with_struct/arm64_win.expect
new file mode 100644
index 0000000..a2cdd9d
--- /dev/null
+++ b/runtime/vm/compiler/ffi/unit_tests/variadic_with_struct/arm64_win.expect
@@ -0,0 +1,5 @@
+v0 double
+P(r0 int64) Struct(size: 20)
+v1 double
+=>
+v0 double