diff options
author | David Wrighton <davidwr@microsoft.com> | 2018-10-30 18:05:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 18:05:39 -0700 |
commit | e14a9ad013ad307b282def301cbf86e4252cca16 (patch) | |
tree | 6811e0c0148ab8d8706388cb2fc5817640babaf4 /tests/src/Interop | |
parent | f68e75abf03e5a0320d1b9c8af4991ed941a7bba (diff) | |
download | coreclr-e14a9ad013ad307b282def301cbf86e4252cca16.tar.gz coreclr-e14a9ad013ad307b282def301cbf86e4252cca16.tar.bz2 coreclr-e14a9ad013ad307b282def301cbf86e4252cca16.zip |
Add support for large number of argumets in CCW call on Arm64 (#20670)
* Fix CCW with large numbers of arguments on arm64
- Correctly align the stack in COMToCLRDispatchHelper
- Add tests for naturally 16 byte aligned stack growth, and non-aligned growth
* New many arguments COM test
* Add support for the IL stub ETW diagnostic event
Diffstat (limited to 'tests/src/Interop')
6 files changed, 108 insertions, 0 deletions
diff --git a/tests/src/Interop/COM/NETClients/Primitives/NumericTests.cs b/tests/src/Interop/COM/NETClients/Primitives/NumericTests.cs index e184d0d722..19d0574063 100644 --- a/tests/src/Interop/COM/NETClients/Primitives/NumericTests.cs +++ b/tests/src/Interop/COM/NETClients/Primitives/NumericTests.cs @@ -37,6 +37,7 @@ namespace NetClient this.Marshal_Float(a / 100f, b / 100f); this.Marshal_Double(a / 100.0, b / 100.0); + this.Marshal_ManyInts(); } static private bool EqualByBound(float expected, float actual) @@ -189,5 +190,15 @@ namespace NetClient this.server.Add_Double_Out(a, b, out c); Assert.IsTrue(EqualByBound(expected, c)); } + + private void Marshal_ManyInts() + { + var expected = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11; + Console.WriteLine($"{expected.GetType().Name} 11 test invariant: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = {expected}"); + Assert.IsTrue(expected == this.server.Add_ManyInts11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)); + expected = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12; + Console.WriteLine($"{expected.GetType().Name} 12 test invariant: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 = {expected}"); + Assert.IsTrue(expected == this.server.Add_ManyInts12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)); + } } } diff --git a/tests/src/Interop/COM/NETServer/NumericTesting.cs b/tests/src/Interop/COM/NETServer/NumericTesting.cs index c6b11630ef..4ed713de53 100644 --- a/tests/src/Interop/COM/NETServer/NumericTesting.cs +++ b/tests/src/Interop/COM/NETServer/NumericTesting.cs @@ -190,4 +190,14 @@ public class NumericTesting : Server.Contract.INumericTesting { c = a + b; } + + public int Add_ManyInts11(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11) + { + return i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11; + } + + public int Add_ManyInts12(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12) + { + return i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12; + } }
\ No newline at end of file diff --git a/tests/src/Interop/COM/NativeClients/Primitives/NumericTests.cpp b/tests/src/Interop/COM/NativeClients/Primitives/NumericTests.cpp index 3d1a624349..4afebb3c22 100644 --- a/tests/src/Interop/COM/NativeClients/Primitives/NumericTests.cpp +++ b/tests/src/Interop/COM/NativeClients/Primitives/NumericTests.cpp @@ -196,6 +196,25 @@ namespace THROW_IF_FAILED(numericTesting->Add_Double_Out(a, b, &c)); THROW_FAIL_IF_FALSE(EqualByBound(expected, c)); } + + void MarshalManyInts(_In_ INumericTesting *numericTesting) + { + HRESULT hr; + + int expected = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11; + ::printf("Many ints 11 test invariant: 1 + 2 + 3 + 4... + 11 = %d\n", expected); + + int result = 0; + THROW_IF_FAILED(numericTesting->Add_ManyInts11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, &result)); + THROW_FAIL_IF_FALSE(result == expected); + + expected = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12; + ::printf("Many ints 12 test invariant: 1 + 2 + 3 + 4... + 11 + 12= %d\n", expected); + + result = 0; + THROW_IF_FAILED(numericTesting->Add_ManyInts12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, &result)); + THROW_FAIL_IF_FALSE(result == expected); + } } void Run_NumericTests() @@ -224,4 +243,5 @@ void Run_NumericTests() MarshalULong(numericTesting, (uint64_t)a, (uint64_t)b); MarshalFloat(numericTesting, (float)a / 100.f, (float)b / 100.f); MarshalDouble(numericTesting, (double)a / 100.0, (double)b / 100.0); + MarshalManyInts(numericTesting); } diff --git a/tests/src/Interop/COM/NativeServer/NumericTesting.h b/tests/src/Interop/COM/NativeServer/NumericTesting.h index a6e76ec7a6..aa703be468 100644 --- a/tests/src/Interop/COM/NativeServer/NumericTesting.h +++ b/tests/src/Interop/COM/NativeServer/NumericTesting.h @@ -246,6 +246,43 @@ public: return S_OK; } + DEF_FUNC(Add_ManyInts11)( + /*[in]*/ int i1, + /*[in]*/ int i2, + /*[in]*/ int i3, + /*[in]*/ int i4, + /*[in]*/ int i5, + /*[in]*/ int i6, + /*[in]*/ int i7, + /*[in]*/ int i8, + /*[in]*/ int i9, + /*[in]*/ int i10, + /*[in]*/ int i11, + /*[out]*/ int * result ) + { + *result = i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11; + return S_OK; + } + + DEF_FUNC(Add_ManyInts12)( + /*[in]*/ int i1, + /*[in]*/ int i2, + /*[in]*/ int i3, + /*[in]*/ int i4, + /*[in]*/ int i5, + /*[in]*/ int i6, + /*[in]*/ int i7, + /*[in]*/ int i8, + /*[in]*/ int i9, + /*[in]*/ int i10, + /*[in]*/ int i11, + /*[in]*/ int i12, + /*[out]*/ int * result ) + { + *result = i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12; + return S_OK; + } + public: // IUnknown STDMETHOD(QueryInterface)( /* [in] */ REFIID riid, diff --git a/tests/src/Interop/COM/ServerContracts/Server.Contracts.cs b/tests/src/Interop/COM/ServerContracts/Server.Contracts.cs index 0aa247f078..cc003edf68 100644 --- a/tests/src/Interop/COM/ServerContracts/Server.Contracts.cs +++ b/tests/src/Interop/COM/ServerContracts/Server.Contracts.cs @@ -44,6 +44,9 @@ namespace Server.Contract void Add_ULong_Out(ulong a, ulong b, out ulong c); void Add_Float_Out(float a, float b, out float c); void Add_Double_Out(double a, double b, out double c); + + int Add_ManyInts11(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11); + int Add_ManyInts12(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12); } [ComVisible(true)] diff --git a/tests/src/Interop/COM/ServerContracts/Server.Contracts.h b/tests/src/Interop/COM/ServerContracts/Server.Contracts.h index 972310615e..a15f39fb01 100644 --- a/tests/src/Interop/COM/ServerContracts/Server.Contracts.h +++ b/tests/src/Interop/COM/ServerContracts/Server.Contracts.h @@ -148,6 +148,33 @@ INumericTesting : IUnknown /*[in]*/ double a, /*[in]*/ double b, /*[out]*/ double * c ) = 0; + virtual HRESULT STDMETHODCALLTYPE Add_ManyInts11 ( + /*[in]*/ int i1, + /*[in]*/ int i2, + /*[in]*/ int i3, + /*[in]*/ int i4, + /*[in]*/ int i5, + /*[in]*/ int i6, + /*[in]*/ int i7, + /*[in]*/ int i8, + /*[in]*/ int i9, + /*[in]*/ int i10, + /*[in]*/ int i11, + /*[out]*/ int * result ) = 0; + virtual HRESULT STDMETHODCALLTYPE Add_ManyInts12 ( + /*[in]*/ int i1, + /*[in]*/ int i2, + /*[in]*/ int i3, + /*[in]*/ int i4, + /*[in]*/ int i5, + /*[in]*/ int i6, + /*[in]*/ int i7, + /*[in]*/ int i8, + /*[in]*/ int i9, + /*[in]*/ int i10, + /*[in]*/ int i11, + /*[in]*/ int i12, + /*[out]*/ int * result ) = 0; }; struct __declspec(uuid("7731cb31-e063-4cc8-bcd2-d151d6bc8f43")) |