diff options
author | Fadi Hanna <fadim@microsoft.com> | 2017-06-15 04:28:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-15 04:28:04 +0300 |
commit | 962401ec638db2073d16d45eb8e0b1a3167452ba (patch) | |
tree | fa71d97074462e0594936a1fafc366bf9f5ef828 /src/ILCompiler.TypeSystem | |
parent | c531b93451f52b444a32d92e2c05f8e76585f1c4 (diff) |
GVM dependency analysis performance fixes (#3872)
Refactor GVM algorithm for better performance
Fix GVM resolution bug on derived types
Fix bug with variance (https://github.com/dotnet/corert/issues/3454)
Diffstat (limited to 'src/ILCompiler.TypeSystem')
-rw-r--r-- | src/ILCompiler.TypeSystem/tests/ConstraintsValidationTest.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ILCompiler.TypeSystem/tests/ConstraintsValidationTest.cs b/src/ILCompiler.TypeSystem/tests/ConstraintsValidationTest.cs index 4691be685..95bc0b5e7 100644 --- a/src/ILCompiler.TypeSystem/tests/ConstraintsValidationTest.cs +++ b/src/ILCompiler.TypeSystem/tests/ConstraintsValidationTest.cs @@ -259,6 +259,27 @@ namespace TypeSystemTests instantiatedType = _multipleConstraintsType.MakeInstantiatedType(_classArgWithDefaultCtorType, _context.GetWellKnownType(WellKnownType.Object)); Assert.True(instantiatedType.CheckConstraints()); } + + // InvalidInstantiationArgs + { + var pointer = _context.GetWellKnownType(WellKnownType.Int16).MakePointerType(); + var byref = _context.GetWellKnownType(WellKnownType.Int16).MakeByRefType(); + + Assert.False(_iGenType.Instantiation.CheckValidInstantiationArguments()); + + instantiatedType = _iGenType.MakeInstantiatedType(_context.GetWellKnownType(WellKnownType.Void)); + Assert.False(instantiatedType.Instantiation.CheckValidInstantiationArguments()); + + instantiatedType = _iGenType.MakeInstantiatedType(pointer); + Assert.False(instantiatedType.Instantiation.CheckValidInstantiationArguments()); + + instantiatedType = _iGenType.MakeInstantiatedType(byref); + Assert.False(instantiatedType.Instantiation.CheckValidInstantiationArguments()); + + instantiatedType = _iGenType.MakeInstantiatedType(byref); + instantiatedType = _iGenType.MakeInstantiatedType(instantiatedType); + Assert.False(instantiatedType.Instantiation.CheckValidInstantiationArguments()); + } } } } |