Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2016-07-05 17:27:14 +0300
committerGitHub <noreply@github.com>2016-07-05 17:27:14 +0300
commit79e23ab784e751d5efe7a9ce654cbcba2e112700 (patch)
tree47fd5c2986cb1e642e4bba23d258396354368ccb
parent0d06b597263111051bed5214564ee7099840a6e1 (diff)
parent3d74189386b523164f8d5a98199c72559c03bf9e (diff)
Merge pull request #3236 from kumpera/coreclr-testsuite-fixes-2
Reduce coreclr test failures by 10. A bunch of fixes and a bunch of disables.
-rw-r--r--acceptance-tests/coreclr.mk30
-rw-r--r--mcs/ilasm/codegen/TypeDef.cs4
-rw-r--r--mono/mini/alias-analysis.c2
-rw-r--r--mono/mini/method-to-ir.c47
-rw-r--r--mono/mini/mini-amd64.c2
5 files changed, 73 insertions, 12 deletions
diff --git a/acceptance-tests/coreclr.mk b/acceptance-tests/coreclr.mk
index 8f75b05470f..1f4be3d1e8f 100644
--- a/acceptance-tests/coreclr.mk
+++ b/acceptance-tests/coreclr.mk
@@ -262,9 +262,7 @@ CORECLR_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/JIT/Directed/intrinsic/pow/pow2.cs \
$(CORECLR_PATH)/tests/src/JIT/Directed/intrinsic/pow/pow3.cs \
$(CORECLR_PATH)/tests/src/JIT/Directed/lifetime/lifetime1.cs \
- $(CORECLR_PATH)/tests/src/JIT/Directed/lifetime/lifetime2.cs \
$(CORECLR_PATH)/tests/src/JIT/Directed/localloc/localloc3.cs \
- $(CORECLR_PATH)/tests/src/JIT/Directed/newarr/newarr.cs \
$(CORECLR_PATH)/tests/src/JIT/Directed/shift/int16.cs \
$(CORECLR_PATH)/tests/src/JIT/Directed/shift/int32.cs \
$(CORECLR_PATH)/tests/src/JIT/Directed/shift/int64.cs \
@@ -1279,7 +1277,6 @@ CORECLR_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/whidbeybeta2/349379/349379.cs \
$(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/whidbeybeta2/366085/366085.cs \
$(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/whidbeym3.3/106011/106011.cs \
- $(CORECLR_PATH)/tests/src/baseservices/exceptions/sharedexceptions/emptystacktrace/oomexception01.cs \
$(CORECLR_PATH)/tests/src/baseservices/exceptions/simple/finally.cs \
$(CORECLR_PATH)/tests/src/baseservices/exceptions/unittests/returnfromcatch.cs \
$(CORECLR_PATH)/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_threadpoolnullchecks/cs_threadpoolnullchecks.cs \
@@ -4003,6 +4000,15 @@ CORECLR_DISABLED_TEST_CS_SRC += \
# this test makes no sense, the expected pattern is the English one for all cultures
CORECLR_DISABLED_TEST_CS_SRC += $(CORECLR_PATH)/tests/src/Regressions/coreclr/0584/test584.cs
+# Requires precise stack scanning
+CORECLR_DISABLED_TEST_CS_SRC += \
+ $(CORECLR_PATH)/tests/src/JIT/Directed/lifetime/lifetime2.cs
+
+# Depends on small array behavior of .net. Mono supports objects > 2Gb on 64bits and the following tests verify for that
+CORECLR_DISABLED_TEST_CS_SRC += \
+ $(CORECLR_PATH)/tests/src/JIT/Directed/newarr/newarr.cs \
+ $(CORECLR_PATH)/tests/src/baseservices/exceptions/sharedexceptions/emptystacktrace/oomexception01.cs
+
CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/BBT/Scenario4/Not-Int32.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/Convert/implicitConv.il \
@@ -4073,7 +4079,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Directed/array-il/simple3.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/importer/badendfinally.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/importer/badtailcall.il \
- $(CORECLR_PATH)/tests/src/JIT/Directed/coverage/importer/byrefsubbyref1.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/importer/calli2.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/importer/ceeillegal.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/importer/ldelemnullarr2.il \
@@ -4087,14 +4092,12 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/importer/volatilldind.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/importer/volatilstind.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/arrgetlen.il \
- $(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/lcliimpl.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/ldsshrstsfld.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/ldvirtftncalli.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/ovfldiv2.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/ovflrem2.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/stfldstatic1.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/stfldstatic2.il \
- $(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/subbyref.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/switchdefaultonly1.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/switchdefaultonly2.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/switchdefaultonly3.il \
@@ -5118,6 +5121,21 @@ CORECLR_DISABLED_TEST_IL_SRC += \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28901/b28901.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/clr-x64-JIT/v2.1/b173569/b173569.il
+
+# Bad test that tries an implicit cast from int32 to byref
+CORECLR_DISABLED_TEST_IL_SRC += \
+ $(CORECLR_PATH)/tests/src/JIT/Directed/coverage/importer/byrefsubbyref1.il
+
+# Bad test that tries to implicit cast from bytef to int32
+CORECLR_DISABLED_TEST_IL_SRC += \
+ $(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/subbyref.il
+
+# Bad test that tries to assign a byref to a class to a byref of an interface that class implements
+# This is unsafe because the byref is mutable and would allow you to store the wrong type on that cell.
+CORECLR_DISABLED_TEST_IL_SRC += \
+ $(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/lcliimpl.il
+
+
# find all CoreCLR *.il test files that aren't mentioned in this file
CORECLR_DEFINED_IL_SRC = $(CORECLR_TEST_IL_SRC) $(CORECLR_DISABLED_TEST_IL_SRC)
CORECLR_UPSTREAM_IL_SRC=$(shell find "$(CORECLR_PATH)/tests" -iname "*.il")
diff --git a/mcs/ilasm/codegen/TypeDef.cs b/mcs/ilasm/codegen/TypeDef.cs
index 793e47c8a2a..74200cddf49 100644
--- a/mcs/ilasm/codegen/TypeDef.cs
+++ b/mcs/ilasm/codegen/TypeDef.cs
@@ -348,8 +348,10 @@ namespace Mono.ILASM {
if (IsValueType (parent.PeapiClass.nameSpace, parent.PeapiClass.name))
is_value_class = true;
- else if (IsEnumType (parent.PeapiClass.nameSpace, parent.PeapiClass.name))
+ else if (IsEnumType (parent.PeapiClass.nameSpace, parent.PeapiClass.name)) {
is_enum_class = true;
+ is_value_class = false;
+ }
if (!IsValueType (name_space, name) && !IsEnumType (name_space, name) &&
is_value_class && (attr & PEAPI.TypeAttr.Sealed) == 0) {
diff --git a/mono/mini/alias-analysis.c b/mono/mini/alias-analysis.c
index f40070aeb38..ebab8ae4b25 100644
--- a/mono/mini/alias-analysis.c
+++ b/mono/mini/alias-analysis.c
@@ -226,7 +226,7 @@ handle_instruction:
}
}
break;
-
+ //FIXME missing storei1_membase_imm and storei2_membase_imm
case OP_STORE_MEMBASE_IMM:
case OP_STOREI4_MEMBASE_IMM:
case OP_STOREI8_MEMBASE_IMM:
diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c
index d27182afb31..78273ea20de 100644
--- a/mono/mini/method-to-ir.c
+++ b/mono/mini/method-to-ir.c
@@ -661,6 +661,24 @@ mono_find_block_region (MonoCompile *cfg, int offset)
return -1;
}
+static gboolean
+ip_in_finally_clause (MonoCompile *cfg, int offset)
+{
+ MonoMethodHeader *header = cfg->header;
+ MonoExceptionClause *clause;
+ int i;
+
+ for (i = 0; i < header->num_clauses; ++i) {
+ clause = &header->clauses [i];
+ if (clause->flags != MONO_EXCEPTION_CLAUSE_FINALLY && clause->flags != MONO_EXCEPTION_CLAUSE_FAULT)
+ continue;
+
+ if (MONO_OFFSET_IN_HANDLER (clause, offset))
+ return TRUE;
+ }
+ return FALSE;
+}
+
static GList*
mono_find_final_block (MonoCompile *cfg, unsigned char *ip, unsigned char *target, int type)
{
@@ -2197,7 +2215,6 @@ target_type_is_incompatible (MonoCompile *cfg, MonoType *target, MonoInst *arg)
if (target->byref) {
/* FIXME: check that the pointed to types match */
if (arg->type == STACK_MP) {
- if (cfg->verbose_level) printf ("ok\n");
/* This is needed to handle gshared types + ldaddr. We lower the types so we can handle enums and other typedef-like types. */
MonoClass *target_class_lowered = mono_class_from_mono_type (mini_get_underlying_type (&mono_class_from_mono_type (target)->byval_arg));
MonoClass *source_class_lowered = mono_class_from_mono_type (mini_get_underlying_type (&arg->klass->byval_arg));
@@ -9033,6 +9050,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
for (i = 0; i < n; ++i)
EMIT_NEW_ARGLOAD (cfg, call->args [i], i);
+ if (mini_type_is_vtype (mini_get_underlying_type (call->signature->ret)))
+ call->vret_var = cfg->vret_addr;
+
mono_arch_emit_call (cfg, call);
cfg->param_area = MAX(cfg->param_area, call->stack_usage);
MONO_ADD_INS (cfg->cbb, (MonoInst*)call);
@@ -12269,6 +12289,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
INLINE_FAILURE ("throw");
break;
case CEE_ENDFINALLY:
+ if (!ip_in_finally_clause (cfg, ip - header->code))
+ UNVERIFIED;
/* mono_save_seq_point_info () depends on this */
if (sp != stack_start)
emit_seq_point (cfg, method, ip, FALSE, FALSE);
@@ -13229,8 +13251,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
ip += 4;
inline_costs += 1;
break;
- case CEE_LOCALLOC:
+ case CEE_LOCALLOC: {
CHECK_STACK (1);
+ MonoBasicBlock *non_zero_bb, *end_bb;
+ int alloc_ptr = alloc_preg (cfg);
--sp;
if (sp != stack_start)
UNVERIFIED;
@@ -13242,8 +13266,20 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
*/
INLINE_FAILURE("localloc");
+ NEW_BBLOCK (cfg, non_zero_bb);
+ NEW_BBLOCK (cfg, end_bb);
+
+ /* if size != zero */
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, sp [0]->dreg, 0);
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBNE_UN, non_zero_bb);
+
+ //size is zero, so result is NULL
+ MONO_EMIT_NEW_PCONST (cfg, alloc_ptr, NULL);
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, end_bb);
+
+ MONO_START_BB (cfg, non_zero_bb);
MONO_INST_NEW (cfg, ins, OP_LOCALLOC);
- ins->dreg = alloc_preg (cfg);
+ ins->dreg = alloc_ptr;
ins->sreg1 = sp [0]->dreg;
ins->type = STACK_PTR;
MONO_ADD_INS (cfg->cbb, ins);
@@ -13252,9 +13288,14 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
if (init_locals)
ins->flags |= MONO_INST_INIT;
+ MONO_START_BB (cfg, end_bb);
+ EMIT_NEW_UNALU (cfg, ins, OP_MOVE, alloc_preg (cfg), alloc_ptr);
+ ins->type = STACK_PTR;
+
*sp++ = ins;
ip += 2;
break;
+ }
case CEE_ENDFILTER: {
MonoExceptionClause *clause, *nearest;
int cc;
diff --git a/mono/mini/mini-amd64.c b/mono/mini/mini-amd64.c
index 073a818a514..054aa4017ae 100644
--- a/mono/mini/mini-amd64.c
+++ b/mono/mini/mini-amd64.c
@@ -6708,7 +6708,7 @@ mono_arch_emit_prolog (MonoCompile *cfg)
#if defined(TARGET_WIN32) || defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK)
guint32 remaining_size = alloc_size;
/*FIXME handle unbounded code expansion, we should use a loop in case of more than X interactions*/
- guint32 required_code_size = ((remaining_size / 0x1000) + 1) * 10; /*10 is the max size of amd64_alu_reg_imm + amd64_test_membase_reg*/
+ guint32 required_code_size = ((remaining_size / 0x1000) + 1) * 11; /*11 is the max size of amd64_alu_reg_imm + amd64_test_membase_reg*/
guint32 offset = code - cfg->native_code;
if (G_UNLIKELY (required_code_size >= (cfg->code_size - offset))) {
while (required_code_size >= (cfg->code_size - offset))