diff options
author | Juan Antonio Cano <jacanosalado@gmail.com> | 2017-10-15 03:19:24 +0300 |
---|---|---|
committer | Morgan Brown <morganbr@users.noreply.github.com> | 2017-10-15 03:19:24 +0300 |
commit | ea81a1844f860d5b0548be2c4163c7216670c3bd (patch) | |
tree | bcfda1292f75e2c9315f096ba65ae3003baeec96 /tests | |
parent | 2d187d8b28cdcce4b5d984c5fa37e6a9b1c58730 (diff) |
Implement neg (float/integer) and not IL instructions. Fixes #4524 and #4525 (#4725)
* Implement neg (float/integer) and not IL instructions. Fixes #4524 and #4525
* Neg and not basic tests added to HelloWasm.
Name parameter updated in LLVM build methods to reflect the operation being built.
Use PushExpression method instead of direct push to stack.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/Simple/HelloWasm/Program.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/src/Simple/HelloWasm/Program.cs b/tests/src/Simple/HelloWasm/Program.cs index 6e25152c8..4c3015816 100644 --- a/tests/src/Simple/HelloWasm/Program.cs +++ b/tests/src/Simple/HelloWasm/Program.cs @@ -23,6 +23,20 @@ internal static class Program string s = "Hello from C#!"; PrintString(s, 14); } + + var not = Not(0xFFFFFFFF) == 0x00000000; + if(not) + { + PrintString("\n", 1); + PrintString("not test: Ok.", 13); + } + + var negInt = Neg(42) == -42; + if(negInt) + { + PrintString("\n", 1); + PrintString("negInt test: Ok.", 16); + } } private static unsafe void PrintString(string s, int length) @@ -42,6 +56,16 @@ internal static class Program { return a + b; } + + private static uint Not(uint a) + { + return ~a; + } + + private static int Neg(int a) + { + return -a; + } [DllImport("*")] private static unsafe extern int printf(byte* str, byte* unused); |