diff options
author | Jeff Greene <hippiehunterenator@gmail.com> | 2017-10-21 02:22:16 +0300 |
---|---|---|
committer | Morgan Brown <morganbr@users.noreply.github.com> | 2017-10-21 02:22:16 +0300 |
commit | e1f836328768bae7652ab41eecfc96e511944612 (patch) | |
tree | 3b32a05be8f5861425310fe3c8c3dc3fc3523e81 /tests | |
parent | 6af53ab981ead6e35f44cf39b1ae19e3089ea344 (diff) |
Added support for ldsfld/stsfld/ldsflda/ldflda including general value type support (#4729)
Added support for ldsfld/stsfld/ldsflda/ldflda including general value type support, throw on invalid branches to the first basicblock in a routine and ensure type sameness for icmp
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/Simple/HelloWasm/Program.cs | 72 |
1 files changed, 43 insertions, 29 deletions
diff --git a/tests/src/Simple/HelloWasm/Program.cs b/tests/src/Simple/HelloWasm/Program.cs index 63608fe6b..fc5e7ea2b 100644 --- a/tests/src/Simple/HelloWasm/Program.cs +++ b/tests/src/Simple/HelloWasm/Program.cs @@ -7,53 +7,67 @@ using System.Runtime.InteropServices; internal static class Program { + private static int staticInt; private static unsafe void Main(string[] args) { Add(1, 2); int tempInt = 0; (*(&tempInt)) = 9; - + TwoByteStr str = new TwoByteStr() { first = 1, second = 2 }; - TwoByteStr str2 = new TwoByteStr() { first = 3, second = 4 };; + TwoByteStr str2 = new TwoByteStr() { first = 3, second = 4 }; ; *(&str) = str2; str2 = *(&str); - - if(tempInt == 9) - { - string s = "Hello from C#!"; - PrintString(s); - } - - var not = Not(0xFFFFFFFF) == 0x00000000; - if(not) - { - PrintString("\n"); - PrintString("not test: Ok."); - } - - var negInt = Neg(42) == -42; - if(negInt) - { - PrintString("\n"); - PrintString("negInt test: Ok."); - } + + if (tempInt == 9) + { + string s = "Hello from C#!"; + PrintString(s); + } + + staticInt = 5; + if (staticInt == 5) + { + PrintString("\n"); + PrintString("static int field test: Ok."); + } + + if (str.second == 4) + { + PrintString("\n"); + PrintString("value type int field test: Ok."); + } + + var not = Not(0xFFFFFFFF) == 0x00000000; + if (not) + { + PrintString("\n"); + PrintString("not test: Ok."); + } + + var negInt = Neg(42) == -42; + if (negInt) + { + PrintString("\n"); + PrintString("negInt test: Ok."); + } var shiftLeft = ShiftLeft(1, 2) == 4; - if(shiftLeft) + if (shiftLeft) { PrintString("\n"); PrintString("shiftLeft test: Ok."); } var shiftRight = ShiftRight(4, 2) == 1; - if(shiftRight) + if (shiftRight) { PrintString("\n"); PrintString("shiftRight test: Ok."); } var unsignedShift = UnsignedShift(0xFFFFFFFFu, 4) == 0x0FFFFFFFu; - if(unsignedShift) + if (unsignedShift) { PrintString("\n"); PrintString("unsignedShift test: Ok."); @@ -78,13 +92,13 @@ internal static class Program { return a + b; } - - private static uint Not(uint a) + + private static uint Not(uint a) { return ~a; } - - private static int Neg(int a) + + private static int Neg(int a) { return -a; } |