diff options
author | Blealtan <blealtan@outlook.com> | 2018-02-28 06:30:54 +0300 |
---|---|---|
committer | Morgan Brown <morganbr@users.noreply.github.com> | 2018-02-28 06:30:54 +0300 |
commit | beff0a43b2635ff5acdcb413c037d3ecc97864cb (patch) | |
tree | 2a503e5d02457386546fb127b1acee4cb5152b48 /tests | |
parent | 76899b2aaef6e30297e06ba7043995c1b2336c42 (diff) |
Implement intrinsic call to RuntimeHelpers.InitializeArray for WASM (#5377)
* Implement intrinsic call to InitializeArray.
RuntimeHelpers.InitializeArray is implemented as a call to LLVM
intrinsic llvm.memcpy.p0i8.p0i8.i32, which copies from generated global
constant to provided target array.
Currently the base size of the array object is hardcoded to 8, since no
EEType is provided in the intrinsic call.
Fix #5345.
Add testing code for InitializeArray in HelloWasm.
Roslyn generates RuntimeHelpers.InitializeArray for arrays of integral
types with initializer of length greater or equal than 3. Here we use
this feature to generate a call to RuntimeHelpers.InitializeArray for
test.
Catagorize array argument types in InitializeArray
Differently handle vectors, multidimensional arrays and object typed
arrays in InitializeArray intrinsic.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/Simple/HelloWasm/Program.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/src/Simple/HelloWasm/Program.cs b/tests/src/Simple/HelloWasm/Program.cs index 812101795..75864c2e0 100644 --- a/tests/src/Simple/HelloWasm/Program.cs +++ b/tests/src/Simple/HelloWasm/Program.cs @@ -210,6 +210,14 @@ internal static class Program System.Diagnostics.Debugger.Break(); + var testRuntimeHelpersInitArray = new long[] {1, 2, 3}; + if(testRuntimeHelpersInitArray[0] == 1 && + testRuntimeHelpersInitArray[1] == 2 && + testRuntimeHelpersInitArray[2] == 3) + { + PrintLine("Runtime.Helpers array initialization test: Ok."); + } + PrintLine("Done"); } |