diff options
author | Pat Gavlin <pagavlin@microsoft.com> | 2015-12-08 11:52:37 -0800 |
---|---|---|
committer | Pat Gavlin <pagavlin@microsoft.com> | 2015-12-10 15:54:42 -0800 |
commit | fc362c8fe8227bf90fe10295757df92b4df78e2f (patch) | |
tree | 657e7b636e7e9ec0475ee6d17c5c9b960a057943 /tests/src/JIT/Methodical/Arrays/range/int32_0.il | |
parent | a4e23d6bb1b65f961b168769154ce1b53ee2bfc3 (diff) | |
download | coreclr-fc362c8fe8227bf90fe10295757df92b4df78e2f.tar.gz coreclr-fc362c8fe8227bf90fe10295757df92b4df78e2f.tar.bz2 coreclr-fc362c8fe8227bf90fe10295757df92b4df78e2f.zip |
Import missing JIT tests.
These tests were thought to have been ported earlier.
Diffstat (limited to 'tests/src/JIT/Methodical/Arrays/range/int32_0.il')
-rw-r--r-- | tests/src/JIT/Methodical/Arrays/range/int32_0.il | 215 |
1 files changed, 215 insertions, 0 deletions
diff --git a/tests/src/JIT/Methodical/Arrays/range/int32_0.il b/tests/src/JIT/Methodical/Arrays/range/int32_0.il new file mode 100644 index 0000000000..c6b83e46c0 --- /dev/null +++ b/tests/src/JIT/Methodical/Arrays/range/int32_0.il @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + + + + + + +.assembly extern System.Console +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) + .ver 4:0:0:0 +} + +.assembly extern mscorlib +{ + + + + +} +.assembly 'test' +{ + + + + +} +.module 'test.exe' +.namespace JitTest +{ + .class private auto ansi Test + extends [mscorlib]System.Object + { + .method private hidebysig static int32 + try_index(int32[0...] arr, + int32 idx, + int32 expected) il managed + { + .maxstack 5 + .locals (int32) + ldstr "Trying index " + call void [System.Console]System.Console::Write(string) + ldarga.s idx + call instance string [mscorlib]System.Int32::ToString() + call void [System.Console]System.Console::Write(string) + .try + { + ldarg.0 + ldarg.1 + ldarg.1 + stelem.i4 + + ldarg.0 + ldarg.1 + ldelem.i4 + + ldarg.1 + ceq + brtrue aaa + + ldstr "READ-WRITE FAILED" + call void [System.Console]System.Console::WriteLine(string) + newobj instance void [mscorlib]System.ApplicationException::.ctor() + throw + + aaa: + + ldstr ": OK" + call void [System.Console]System.Console::WriteLine(string) + ldc.i4.1 + stloc.0 + leave.s IL_0029 + + } // end .try + catch [mscorlib]System.Object + { + IL_001c: pop + IL_001d: ldstr ": exception!" + IL_0022: call void [System.Console]System.Console::WriteLine(string) + + ldc.i4.0 + stloc.0 + IL_0027: leave.s IL_0029 + + } // end handler + IL_0029: + ldloc.0 + ldarg.2 + ceq + ret + } // end of method 'Test::try_index' + + .method private hidebysig static int32 + Main() il managed + { + .entrypoint + .maxstack 4 + .locals (int32[0...] V_0, + int32 V_1, + int32 V_2) + + ldstr "Creating array of 16 elements" + call void [System.Console]System.Console::WriteLine(string) + + ldc.i4.s 16 + newobj instance void int32[0...]::.ctor(int32) + stloc.0 + + ldstr "Reported array size is " + call void [System.Console]System.Console::Write(string) + ldloc.0 + ldlen + call void [System.Console]System.Console::WriteLine(int32) + + ldstr "[mscorlib]System.Array::get_Rank returned " + call void [System.Console]System.Console::Write(string) + ldloc.0 + callvirt instance int32 [mscorlib]System.Array::get_Rank() + call void [System.Console]System.Console::WriteLine(int32) + + ldstr "[mscorlib]System.Array::GetLowerBound returned " + call void [System.Console]System.Console::Write(string) + ldloc.0 + ldc.i4.0 + callvirt instance int32 [mscorlib]System.Array::GetLowerBound(int32) + call void [System.Console]System.Console::WriteLine(int32) + + ldstr "[mscorlib]System.Array::GetUpperBound returned " + call void [System.Console]System.Console::Write(string) + ldloc.0 + ldc.i4.0 + callvirt instance int32 [mscorlib]System.Array::GetUpperBound(int32) + call void [System.Console]System.Console::WriteLine(int32) + + ldloc.0 + ldc.i4 -10000 + ldc.i4.0 + call int32 JitTest.Test::try_index(int32[0...], int32, int32) + brfalse Failure + + ldloc.0 + ldc.i4.m1 + ldc.i4.0 + call int32 JitTest.Test::try_index(int32[0...], int32, int32) + brfalse Failure + + ldloc.0 + ldc.i4.0 + ldc.i4.1 + call int32 JitTest.Test::try_index(int32[0...], int32, int32) + brfalse Failure + + ldloc.0 + ldc.i4.1 + ldc.i4.1 + call int32 JitTest.Test::try_index(int32[0...], int32, int32) + brfalse Failure + + ldloc.0 + ldc.i4 15 + ldc.i4.1 + call int32 JitTest.Test::try_index(int32[0...], int32, int32) + brfalse Failure + + ldloc.0 + ldc.i4 16 + ldc.i4.0 + call int32 JitTest.Test::try_index(int32[0...], int32, int32) + brfalse Failure + + ldloc.0 + ldc.i4 1000 + ldc.i4.0 + call int32 JitTest.Test::try_index(int32[0...], int32, int32) + brfalse Failure + + ldloc.0 + ldc.i4 1000000 + ldc.i4.0 + call int32 JitTest.Test::try_index(int32[0...], int32, int32) + brfalse Failure + + ldloc.0 + ldc.i4 1300000 + ldc.i4.0 + call int32 JitTest.Test::try_index(int32[0...], int32, int32) + brfalse Failure + + ldc.i4 0x64 + ldstr "**** PASSED ****" + call void [System.Console]System.Console::WriteLine(string) + br Escape + Failure: + ldc.i4.1 + ldstr "**** FAILED ****" + call void [System.Console]System.Console::WriteLine(string) + Escape: + ret + } // end of method 'Test::Main' + + .method public hidebysig specialname rtspecialname + instance void .ctor() il managed + { + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ret + } // end of method 'Test::.ctor' + + } // end of class 'Test' + +} // end of namespace 'JitTest' + |