summaryrefslogtreecommitdiff
path: root/tests/src/JIT/CodeGenBringUpTests/UDivConst.cs
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2016-05-18 10:33:28 -0700
committerBruce Forstall <brucefo@microsoft.com>2016-05-18 10:33:28 -0700
commitce8e7e3a0d6ad3dd34a8b3487c8068e49c6b45e0 (patch)
treeaba17ec49f0ba939bc66696757f208e4bd43d4cf /tests/src/JIT/CodeGenBringUpTests/UDivConst.cs
parent7d78bb285816c69f39c016950d3add07f650483e (diff)
downloadcoreclr-ce8e7e3a0d6ad3dd34a8b3487c8068e49c6b45e0.tar.gz
coreclr-ce8e7e3a0d6ad3dd34a8b3487c8068e49c6b45e0.tar.bz2
coreclr-ce8e7e3a0d6ad3dd34a8b3487c8068e49c6b45e0.zip
Rollback CS#1603899 that led to a JIT assert ngen'ing System.Windows.Forms.dll
==================== 007551: Merge pull request #1241 from mikedn/modopt Extend the DIV/MOD dividend into RDX:RAX only if needed ==================== Assert failure(PID 33656 [0x00008378], Thread: 17792 [0x4580]): Assertion failed 'addr->OperIsAddrMode() || (addr->IsCnsIntOrI() && addr->isContained()) || !addr->isContained()' in 'System.Windows.Forms.CheckedListBox:OnDrawItem(ref):this' (IL size 1216) File: e:\dd\projectk\src\ndp\clr\src\jit\emitxarch.cpp Line: 2698 Image: C:\Windows\Microsoft.NET\Framework64\v4.0.rb1605209\mscorsvw.exe The tree: ***** BB41, stmt 82 (embedded) ( 6, 8) [003723] ------------ * stmtExpr void (embedded) (IL 0x109... ???) N1045 ( 3, 2) [000115] ------------ | /--* lclVar ref V00 this u:2 REG rcx $80 N1047 ( 1, 4) [002642] ------------ | +--* const long 344 field offset Fseq[idealCheckSize] REG NA $10b N1049 ( 4, 6) [002643] -------N---- | /--* + byref REG NA $356 N1051 ( 6, 8) [000116] ----GO------ | /--* indir int REG rcx <l:$685, c:$2ef> N1053 ( 6, 8) [003669] DA--GO------ \--* st.lclVar int V172 cse1 rcx REG rcx RV During codegen: Generating BB41, stmt 71 Holding variables: [rbx rsi rdi r12-r15] Generating: N1043 ( 3, 2) [000114] ------------ * lclVar int V05 loc3 u:3 r12 (last use) REG r12 RV $31a Generating: N1045 ( 3, 2) [000115] ------------ * lclVar ref V00 this u:2 REG rcx $80 IN00db: mov rcx, gword ptr [V00 rbp+10H] GC regs: 00000040 {rsi} => 00000042 {rcx rsi} Generating: N1047 ( 1, 4) [002642] ------------ * const long 344 field offset Fseq[idealCheckSize] REG NA $10b Generating: N1049 ( 4, 6) [002643] -------N---- * + byref REG NA $356 Generating: N1051 ( 6, 8) [000116] ----GO------ * indir int REG rcx <l:$685, c:$2ef> ... assert ... (This is rollback #2: the TFS/GitHub mirror unfortunately undid rollback CS#1605814 with CS#1605840. This change should avoid that problem.) [tfs-changeset: 1605917]
Diffstat (limited to 'tests/src/JIT/CodeGenBringUpTests/UDivConst.cs')
-rw-r--r--tests/src/JIT/CodeGenBringUpTests/UDivConst.cs219
1 files changed, 0 insertions, 219 deletions
diff --git a/tests/src/JIT/CodeGenBringUpTests/UDivConst.cs b/tests/src/JIT/CodeGenBringUpTests/UDivConst.cs
deleted file mode 100644
index cd507fe554..0000000000
--- a/tests/src/JIT/CodeGenBringUpTests/UDivConst.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System;
-using System.Runtime.CompilerServices;
-
-static class UDivConst
-{
- // U4
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static uint U4_Div_0(uint u4)
- {
- return u4 / 0;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static uint U4_Div_1(uint u4)
- {
- return u4 / 1;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static uint U4_Div_3(uint u4)
- {
- return u4 / 3;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static uint U4_Div_5(uint u4)
- {
- return u4 / 5;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static uint U4_Div_7(uint u4)
- {
- return u4 / 7;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static uint U4_DivPow2_16(uint u4)
- {
- return u4 / 16;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static uint U4_DivPow2_I4Min(uint u4)
- {
- return u4 / 0x80000000u;
- }
-
- // U8
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static ulong U8_Div_0(ulong u8)
- {
- return u8 / 0;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static ulong U8_Div_1(ulong u8)
- {
- return u8 / 1;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static ulong U8_Div_3(ulong u8)
- {
- return u8 / 3;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static ulong U8_Div_5(ulong u8)
- {
- return u8 / 5;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static ulong U8_Div_7(ulong u8)
- {
- return u8 / 7;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static ulong U8_DivUncontained_I8Max(ulong u8)
- {
- return u8 / ulong.MaxValue;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static ulong U8_DivPow2_2(ulong u8)
- {
- return u8 / 2;
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static ulong U8_DivUncontainedPow2_1Shl32(ulong u8)
- {
- return u8 / (1UL << 32);
- }
-}
-
-static class UDivProgram
-{
- public static int Main()
- {
- const int Pass = 100;
- const int Fail = -1;
-
- // U4
-
- try
- {
- UDivConst.U4_Div_0(42);
- return Fail;
- }
- catch (DivideByZeroException)
- {
- }
- catch (Exception)
- {
- return Fail;
- }
-
- if (UDivConst.U4_Div_1(42) != 42)
- {
- return Fail;
- }
-
- if (UDivConst.U4_Div_3(42) != 14)
- {
- return Fail;
- }
-
- if (UDivConst.U4_Div_5(42) != 8)
- {
- return Fail;
- }
-
- if (UDivConst.U4_Div_7(43) != 6)
- {
- return Fail;
- }
-
- if (UDivConst.U4_DivPow2_16(42) != 2)
- {
- return Fail;
- }
-
- if (UDivConst.U4_DivPow2_I4Min(3) != 0)
- {
- return Fail;
- }
-
- if (UDivConst.U4_DivPow2_I4Min(0x80000001u) != 1)
- {
- return Fail;
- }
-
- // U8
-
- try
- {
- UDivConst.U8_Div_0(42);
- return Fail;
- }
- catch (DivideByZeroException)
- {
- }
- catch (Exception)
- {
- return Fail;
- }
-
- if (UDivConst.U8_Div_1(42) != 42)
- {
- return Fail;
- }
-
- if (UDivConst.U8_Div_3(42) != 14)
- {
- return Fail;
- }
-
- if (UDivConst.U8_Div_5(42) != 8)
- {
- return Fail;
- }
-
- if (UDivConst.U8_Div_7(420) != 60)
- {
- return Fail;
- }
-
- if (UDivConst.U8_DivUncontained_I8Max(ulong.MaxValue - 1) != 0)
- {
- return Fail;
- }
-
- if (UDivConst.U8_DivUncontained_I8Max(ulong.MaxValue) != 1)
- {
- return Fail;
- }
-
- if (UDivConst.U8_DivPow2_2(42) != 21)
- {
- return Fail;
- }
-
- if (UDivConst.U8_DivUncontainedPow2_1Shl32(1UL << 33) != 2)
- {
- return Fail;
- }
-
- return Pass;
- }
-}