From 5c6581b713656d07a0887dbbf6dc9c1536d36aae Mon Sep 17 00:00:00 2001 From: Fadi Hanna Date: Thu, 14 Apr 2016 14:14:52 -0700 Subject: Delete fragile tests (will fix tests in a later PR) --- .../Negative/Method_ClassConstraint_Neg.il | 95 ---- .../Negative/Method_ClassConstraint_Neg.ilproj | 38 -- .../Negative/Method_Constraints_Negative.cs | 191 -------- .../Negative/Method_Constraints_Negative.csproj | 48 -- .../Method_DefaultCtorAndClassConstraint_Neg.il | 213 --------- ...Method_DefaultCtorAndClassConstraint_Neg.ilproj | 38 -- .../Method_DefaultCtorAndStructConstraint_Neg.il | 187 -------- ...ethod_DefaultCtorAndStructConstraint_Neg.ilproj | 38 -- .../Negative/Method_DefaultCtorConstraint_Neg.il | 132 ------ .../Method_DefaultCtorConstraint_Neg.ilproj | 38 -- .../Negative/Method_StructConstraint_Neg.il | 182 -------- .../Negative/Method_StructConstraint_Neg.ilproj | 38 -- .../ConstraintsOnMethod/Negative/app.config | 27 -- .../ConstraintsOnMethod/Negative/project.json | 44 -- .../ConstraintsOnMethod/Negative/types.il | 117 ----- .../ConstraintsOnMethod/Negative/types.ilproj | 38 -- .../Positive/Method_ClassConstraint_Pos.il | 171 ------- .../Positive/Method_ClassConstraint_Pos.ilproj | 38 -- .../Positive/Method_Constraints_Positive.cs | 158 ------- .../Positive/Method_Constraints_Positive.csproj | 48 -- .../Method_DefaultCtorAndClassConstraint_Pos.il | 82 ---- ...Method_DefaultCtorAndClassConstraint_Pos.ilproj | 38 -- .../Method_DefaultCtorAndStructConstraint_Pos.il | 110 ----- ...ethod_DefaultCtorAndStructConstraint_Pos.ilproj | 38 -- .../Positive/Method_DefaultCtorConstraint_Pos.il | 134 ------ .../Method_DefaultCtorConstraint_Pos.ilproj | 38 -- .../Positive/Method_StructConstraint_Pos.il | 112 ----- .../Positive/Method_StructConstraint_Pos.ilproj | 38 -- .../ConstraintsOnMethod/Positive/app.config | 27 -- .../ConstraintsOnMethod/Positive/project.json | 35 -- .../ConstraintsOnMethod/Positive/types.il | 117 ----- .../ConstraintsOnMethod/Positive/types.ilproj | 38 -- .../Negative/Instantiation_ClassConstraint_Neg.il | 87 ---- .../Instantiation_ClassConstraint_Neg.ilproj | 38 -- .../Negative/Instantiation_Constraints_Neg.cs | 187 -------- .../Negative/Instantiation_Constraints_Neg.csproj | 48 -- ...tantiation_DefaultCtorAndClassConstraint_Neg.il | 209 --------- ...iation_DefaultCtorAndClassConstraint_Neg.ilproj | 38 -- ...iation_DefaultCtorAndClassTypeConstraint_Neg.il | 223 --------- ...on_DefaultCtorAndClassTypeConstraint_Neg.ilproj | 42 -- ...antiation_DefaultCtorAndStructConstraint_Neg.il | 178 -------- ...ation_DefaultCtorAndStructConstraint_Neg.ilproj | 38 -- .../Instantiation_DefaultCtorConstraint_Neg.il | 146 ------ .../Instantiation_DefaultCtorConstraint_Neg.ilproj | 38 -- .../Negative/Instantiation_StructConstraint_Neg.il | 176 ------- .../Instantiation_StructConstraint_Neg.ilproj | 38 -- .../Interface_DefaultCtorAndClassConstraint_Neg.il | 189 -------- ...erface_DefaultCtorAndClassConstraint_Neg.ilproj | 38 -- ...erface_DefaultCtorAndClassTypeConstraint_Neg.il | 233 ---------- ...ce_DefaultCtorAndClassTypeConstraint_Neg.ilproj | 42 -- ...Interface_DefaultCtorAndStructConstraint_Neg.il | 190 -------- ...rface_DefaultCtorAndStructConstraint_Neg.ilproj | 38 -- .../Interface_DefaultCtorConstraint_Neg.il | 165 ------- .../Interface_DefaultCtorConstraint_Neg.ilproj | 38 -- .../ConstraintsOnType/Negative/RunTestNeg.il | 318 ------------- .../ConstraintsOnType/Negative/RunTestNeg.ilproj | 42 -- .../ConstraintsOnType/Negative/RunTestNeg2.il | 504 --------------------- .../ConstraintsOnType/Negative/RunTestNeg2.ilproj | 38 -- .../ConstraintsOnType/Negative/RunTestNeg3.il | 484 -------------------- .../ConstraintsOnType/Negative/RunTestNeg3.ilproj | 38 -- .../Secondary_Ctor_Constraints_Type_Negative.cs | 208 --------- ...Secondary_Ctor_Constraints_Type_Negative.csproj | 48 -- .../Negative/StaticField_ClassConstraint_Neg.il | 93 ---- .../StaticField_ClassConstraint_Neg.ilproj | 38 -- .../Negative/StaticField_Constraints_Neg.cs | 187 -------- .../Negative/StaticField_Constraints_Neg.csproj | 48 -- ...taticField_DefaultCtorAndClassConstraint_Neg.il | 218 --------- ...cField_DefaultCtorAndClassConstraint_Neg.ilproj | 38 -- ...aticField_DefaultCtorAndStructConstraint_Neg.il | 181 -------- ...Field_DefaultCtorAndStructConstraint_Neg.ilproj | 38 -- .../StaticField_DefaultCtorConstraint_Neg.il | 131 ------ .../StaticField_DefaultCtorConstraint_Neg.ilproj | 38 -- .../Negative/StaticField_StructConstraint_Neg.il | 179 -------- .../StaticField_StructConstraint_Neg.ilproj | 38 -- .../Negative/StaticMethod_ClassConstraint_Neg.il | 87 ---- .../StaticMethod_ClassConstraint_Neg.ilproj | 38 -- .../Negative/StaticMethod_Constraints_Neg.cs | 181 -------- .../Negative/StaticMethod_Constraints_Neg.csproj | 48 -- ...aticMethod_DefaultCtorAndClassConstraint_Neg.il | 187 -------- ...Method_DefaultCtorAndClassConstraint_Neg.ilproj | 38 -- ...ticMethod_DefaultCtorAndStructConstraint_Neg.il | 162 ------- ...ethod_DefaultCtorAndStructConstraint_Neg.ilproj | 38 -- .../StaticMethod_DefaultCtorConstraint_Neg.il | 123 ----- .../StaticMethod_DefaultCtorConstraint_Neg.ilproj | 38 -- .../Negative/StaticMethod_StructConstraint_Neg.il | 162 ------- .../StaticMethod_StructConstraint_Neg.ilproj | 38 -- .../Negative/TypeParam2_Constraints_Neg.cs | 121 ----- .../Negative/TypeParam2_Constraints_Neg.csproj | 43 -- .../Negative/TypeParam3_Constraints_Neg.cs | 123 ----- .../Negative/TypeParam3_Constraints_Neg.csproj | 43 -- .../ConstraintsOnType/Negative/app.config | 27 -- .../ConstraintsOnType/Negative/project.json | 35 -- .../ConstraintsOnType/Negative/types.il | 117 ----- .../ConstraintsOnType/Negative/types.ilproj | 38 -- .../ConstraintsOnType/Negative/types_implementI.il | 131 ------ .../Negative/types_implementI.ilproj | 38 -- .../Negative/types_implementI_extendC.il | 150 ------ .../Negative/types_implementI_extendC.ilproj | 38 -- .../Positive/Instantiation_ClassConstraint_Pos.il | 166 ------- .../Instantiation_ClassConstraint_Pos.ilproj | 38 -- .../Positive/Instantiation_Constraints_Pos.cs | 151 ------ .../Positive/Instantiation_Constraints_Pos.csproj | 48 -- ...tantiation_DefaultCtorAndClassConstraint_Pos.il | 80 ---- ...iation_DefaultCtorAndClassConstraint_Pos.ilproj | 38 -- ...iation_DefaultCtorAndClassTypeConstraint_Pos.il | 77 ---- ...on_DefaultCtorAndClassTypeConstraint_Pos.ilproj | 38 -- ...antiation_DefaultCtorAndStructConstraint_Pos.il | 104 ----- ...ation_DefaultCtorAndStructConstraint_Pos.ilproj | 38 -- .../Instantiation_DefaultCtorConstraint_Pos.il | 144 ------ .../Instantiation_DefaultCtorConstraint_Pos.ilproj | 38 -- .../Positive/Instantiation_StructConstraint_Pos.il | 104 ----- .../Instantiation_StructConstraint_Pos.ilproj | 38 -- .../Interface_DefaultCtorAndClassConstraint_Pos.il | 68 --- ...erface_DefaultCtorAndClassConstraint_Pos.ilproj | 38 -- ...erface_DefaultCtorAndClassTypeConstraint_Pos.il | 68 --- ...ce_DefaultCtorAndClassTypeConstraint_Pos.ilproj | 38 -- ...Interface_DefaultCtorAndStructConstraint_Pos.il | 66 --- ...rface_DefaultCtorAndStructConstraint_Pos.ilproj | 38 -- .../Interface_DefaultCtorConstraint_Pos.il | 86 ---- .../Interface_DefaultCtorConstraint_Pos.ilproj | 38 -- .../ConstraintsOnType/Positive/RunTestPos.il | 52 --- .../ConstraintsOnType/Positive/RunTestPos.ilproj | 42 -- .../ConstraintsOnType/Positive/RunTestPos2.il | 57 --- .../ConstraintsOnType/Positive/RunTestPos2.ilproj | 42 -- .../ConstraintsOnType/Positive/RunTestPos3.il | 57 --- .../ConstraintsOnType/Positive/RunTestPos3.ilproj | 42 -- .../Positive/StaticField_ClassConstraint_Pos.il | 173 ------- .../StaticField_ClassConstraint_Pos.ilproj | 38 -- .../Positive/StaticField_Constraints_Pos.cs | 157 ------- .../Positive/StaticField_Constraints_Pos.csproj | 48 -- ...taticField_DefaultCtorAndClassConstraint_Pos.il | 83 ---- ...cField_DefaultCtorAndClassConstraint_Pos.ilproj | 38 -- ...aticField_DefaultCtorAndStructConstraint_Pos.il | 112 ----- ...Field_DefaultCtorAndStructConstraint_Pos.ilproj | 38 -- .../StaticField_DefaultCtorConstraint_Pos.il | 133 ------ .../StaticField_DefaultCtorConstraint_Pos.ilproj | 38 -- .../Positive/StaticField_StructConstraint_Pos.il | 108 ----- .../StaticField_StructConstraint_Pos.ilproj | 38 -- .../Positive/StaticMethod_ClassConstraint_Pos.il | 154 ------- .../StaticMethod_ClassConstraint_Pos.ilproj | 38 -- .../Positive/StaticMethod_Constraints_Pos.cs | 152 ------- .../Positive/StaticMethod_Constraints_Pos.csproj | 48 -- ...aticMethod_DefaultCtorAndClassConstraint_Pos.il | 79 ---- ...Method_DefaultCtorAndClassConstraint_Pos.ilproj | 38 -- ...ticMethod_DefaultCtorAndStructConstraint_Pos.il | 102 ----- ...ethod_DefaultCtorAndStructConstraint_Pos.ilproj | 38 -- .../StaticMethod_DefaultCtorConstraint_Pos.il | 124 ----- .../StaticMethod_DefaultCtorConstraint_Pos.ilproj | 38 -- .../Positive/StaticMethod_StructConstraint_Pos.il | 101 ----- .../StaticMethod_StructConstraint_Pos.ilproj | 38 -- .../ConstraintsOnType/Positive/app.config | 27 -- .../ConstraintsOnType/Positive/project.json | 35 -- .../ConstraintsOnType/Positive/types.il | 117 ----- .../ConstraintsOnType/Positive/types.ilproj | 38 -- .../ConstraintsOnType/Positive/types_implementI.il | 131 ------ .../Positive/types_implementI.ilproj | 38 -- .../Positive/types_implementI_extendC.il | 151 ------ .../Positive/types_implementI_extendC.ilproj | 38 -- 158 files changed, 14419 deletions(-) delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_ClassConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_ClassConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_Constraints_Negative.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_Constraints_Negative.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndClassConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndClassConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndStructConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndStructConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_StructConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_StructConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/app.config delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/project.json delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/types.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/types.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_ClassConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_ClassConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_Constraints_Positive.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_Constraints_Positive.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndClassConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndClassConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndStructConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndStructConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_StructConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_StructConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/app.config delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/project.json delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/types.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/types.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_ClassConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_ClassConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_Constraints_Neg.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_Constraints_Neg.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassTypeConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassTypeConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndStructConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndStructConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_StructConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_StructConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassTypeConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassTypeConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndStructConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndStructConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg2.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg2.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg3.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg3.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Secondary_Ctor_Constraints_Type_Negative.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Secondary_Ctor_Constraints_Type_Negative.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_ClassConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_ClassConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_Constraints_Neg.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_Constraints_Neg.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndClassConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndClassConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndStructConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndStructConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_StructConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_StructConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_ClassConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_ClassConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_Constraints_Neg.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_Constraints_Neg.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndClassConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndClassConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndStructConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndStructConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_StructConstraint_Neg.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_StructConstraint_Neg.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam2_Constraints_Neg.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam2_Constraints_Neg.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam3_Constraints_Neg.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam3_Constraints_Neg.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/app.config delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/project.json delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI_extendC.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI_extendC.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_ClassConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_ClassConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_Constraints_Pos.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_Constraints_Pos.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassTypeConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassTypeConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndStructConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndStructConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_StructConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_StructConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassTypeConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassTypeConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndStructConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndStructConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos2.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos2.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos3.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos3.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_ClassConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_ClassConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_Constraints_Pos.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_Constraints_Pos.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndClassConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndClassConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndStructConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndStructConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_StructConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_StructConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_ClassConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_ClassConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_Constraints_Pos.cs delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_Constraints_Pos.csproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndClassConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndClassConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndStructConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndStructConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_StructConstraint_Pos.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_StructConstraint_Pos.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/app.config delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/project.json delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI.ilproj delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI_extendC.il delete mode 100644 tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI_extendC.ilproj (limited to 'tests/src') diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_ClassConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_ClassConstraint_Neg.il deleted file mode 100644 index 1ad189851f..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_ClassConstraint_Neg.il +++ /dev/null @@ -1,95 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Method_ClassConstraint_Neg {} - - - -.class public auto ansi beforefieldinit B - extends [mscorlib]System.Object -{ - - // Generic method with class() constraint - .method public hidebysig instance void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit M_ClassConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an enum with no default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1() - ret - } - -} - -.class public auto ansi beforefieldinit M_ClassConstraintGenTypes - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1>() - - ret - } - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1>() - - ret - } - -} - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_ClassConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_ClassConstraint_Neg.ilproj deleted file mode 100644 index 1798e52f10..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_ClassConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Method_ClassConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_Constraints_Negative.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_Constraints_Negative.cs deleted file mode 100644 index 1efac5d6b7..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_Constraints_Negative.cs +++ /dev/null @@ -1,191 +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. - -// NEGATIVE TESTS -/* Test various combinations of constraints on methods -CONSTRAINTS: - -default ctor -reference type -valuetype -default ctor, reference tyoe -default ctor, valuetype - -Test each constraint with -- Class with default nullary ctor (Generic/Non generic) -- Class with no default nullary ctor (Generic/Non generic) -- Class from mscorlib with default nullary ctor -- Abstract Class from mscorlib with no default nullary ctor - -- Struct from mscorlib (Generic/Non generic) -- Struct (Generic/Non generic) -- Enum (Generic/Non generic) - -- Interface (Generic/Non generic) - -- Array - -- Delegate - -- Nullable -*/ - -using System; -using System.Security; - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - - static void Check(Case mytest, string testName, string type, string methodName, string violatingType) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException"); - pass = false; - } - catch (VerificationException e) - { - - - Test.CheckVerificationExceptionMessage(8311, e, type, methodName, violatingType); - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - public static void CheckVerificationExceptionMessage(uint ResourceID, VerificationException e, string type, string methodName, string violatingType) - { - // "Method %1.%2: type argument '%3' violates the constraint of type parameter '%4'." - bool found1 = e.ToString().IndexOf(type + "." + methodName) >= 0; - bool found2 = e.ToString().IndexOf(violatingType) >= 0; - bool found3 = e.ToString().IndexOf("T") >= 0; - - if (!found1 || !found2 || !found3) - { - Console.WriteLine(" : Exception message is incorrect"); - Console.WriteLine("Expected: " + "Method " + type + "." + methodName + ": type argument '" + violatingType + "' violates the constraint of type parameter 'T'"); - Console.WriteLine("Actual: " + e.Message.ToString()); - pass = false; - } - else - { - Console.WriteLine(" : Caught expected exception"); - } - } - - - - public static int Main() - { - pass = true; - - Console.WriteLine("\nNEGATIVE TESTS"); - - Console.WriteLine("\nType: A where T : new()\n"); - - - Check(new Case(M_DefaultCtorConstraint.Test2), "Generic argument is a class with no default ctor", "A", "method1", "ClassNoCtor"); - Check(new Case(M_DefaultCtorConstraint.Test4), "Generic argument is a delegate", "A", "method1", "Delegate1"); - Check(new Case(M_DefaultCtorConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "A", "method1", "System.ValueType"); - Check(new Case(M_DefaultCtorConstraint.Test7), "Generic argument is an interface with no default ctor", "A", "method1", "NonGenInterface"); - - // WRONG? - Check(new Case(M_DefaultCtorConstraint.Test9), "Generic argument is an array of classes with default ctor", "A", "method1", "ClassWithCtor[]"); - - Check(new Case(M_DefaultCtorConstraintGenTypes.Test2), " Generic argument is a generic class with no default ctor", "A", "method1", "GenClassNoCtor[System.Int32]"); - Check(new Case(M_DefaultCtorConstraintGenTypes.Test5), "Generic argument is a generic interface", "A", "method1", "GenInterface[System.Int32]"); - - - Console.WriteLine("\nType: A where T : class()\n"); - - Check(new Case(M_ClassConstraint.Test3), "Generic argument is a struct", "B", "method1", "NonGenStruct"); - Check(new Case(M_ClassConstraint.Test8), "Generic argument is an enum", "B", "method1", "Enum1"); - Check(new Case(M_ClassConstraintGenTypes.Test3), "Generic argument is a generic struct with default ctor", "B", "method1", "GenStruct[System.Int32]"); - Check(new Case(M_ClassConstraintGenTypes.Test6), "Generic argument is Nullable", "B", "method1", "System.Nullable`1[System.Int32]"); - - Console.WriteLine("\nType: A where T : struct()\n"); - - Check(new Case(M_StructConstraint.Test1), "Generic argument is a class with default ctor", "C", "method1", "ClassWithCtor"); - Check(new Case(M_StructConstraint.Test2), "Generic argument is a class with no default ctor", "C", "method1", "ClassNoCtor"); - Check(new Case(M_StructConstraint.Test4), "Generic argument is a delegate", "C", "method1", "Delegate1"); - Check(new Case(M_StructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "C", "method1", "System.Object"); - Check(new Case(M_StructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "C", "method1", "System.ValueType"); - Check(new Case(M_StructConstraint.Test7), "Generic argument is an interface", "C", "method1", "NonGenInterface"); - Check(new Case(M_StructConstraint.Test10), "Generic argument is an array of classes with default ctor", "C", "method1", "ClassWithCtor[]"); - - Check(new Case(M_StructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "C", "method1", "GenClassWithCtor[System.Int32]"); - Check(new Case(M_StructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "C", "method1", "GenClassNoCtor[System.Int32]"); - Check(new Case(M_StructConstraintGenTypes.Test5), "Generic argument is a generic interface", "C", "method1", "GenInterface[System.Int32]"); - Check(new Case(M_StructConstraintGenTypes.Test7), "Generic argument is Nullable", "C", "method1", "System.Nullable`1[System.Int32]"); - - - - Console.WriteLine("\nType: A where T : class(), new() \n"); - - Check(new Case(M_DefaultCtorAndClassConstraint.Test2), "Generic argument is a class with no default ctor", "D", "method1", "ClassNoCtor"); - Check(new Case(M_DefaultCtorAndClassConstraint.Test3), "Generic argument is a struct", "D", "method1", "NonGenStruct"); - Check(new Case(M_DefaultCtorAndClassConstraint.Test4), "Generic argument is a delegate", "D", "method1", "Delegate1"); - Check(new Case(M_DefaultCtorAndClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "D", "method1", "System.ValueType"); - Check(new Case(M_DefaultCtorAndClassConstraint.Test9), "Generic argument is an mscorlib struct", "D", "method1", "System.DateTime"); - Check(new Case(M_DefaultCtorAndClassConstraint.Test7), "Generic argument is an interface", "D", "method1", "NonGenInterface"); - Check(new Case(M_DefaultCtorAndClassConstraint.Test8), "Generic argument is an enum", "D", "method1", "Enum1"); - Check(new Case(M_DefaultCtorAndClassConstraint.Test10), "Generic argument is an array of classes with default ctor", "D", "method1", "ClassWithCtor[]"); - - - Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test3), "Generic argument is a generic struct", "D", "method1", "GenStruct[System.Int32]"); - Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "D", "method1", "GenClassNoCtor[System.Int32]"); - Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test5), "Generic argument is a generic interface", "D", "method1", "GenInterface[System.Int32]"); - Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "D", "method1", "System.Collections.Generic.KeyValuePair`2[NonGenStruct,System.Int32]"); - Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test7), "Generic argument is Nullable", "D", "method1", "System.Nullable`1[System.Int32]"); - - - Console.WriteLine("\nType: A where T : struct(), new()\n"); - - Check(new Case(M_DefaultCtorAndStructConstraint.Test1), "Generic argument is a class with default ctor", "E", "method1", "ClassWithCtor"); - Check(new Case(M_DefaultCtorAndStructConstraint.Test2), "Generic argument is a class with no default ctor", "E", "method1", "ClassNoCtor"); - Check(new Case(M_DefaultCtorAndStructConstraint.Test4), "Generic argument is a delegate", "E", "method1", "Delegate1"); - Check(new Case(M_DefaultCtorAndStructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "E", "method1", "System.Object"); - Check(new Case(M_DefaultCtorAndStructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "E", "method1", "System.ValueType"); - Check(new Case(M_DefaultCtorAndStructConstraint.Test7), "Generic argument is an interface", "E", "method1", "NonGenInterface"); - - Check(new Case(M_DefaultCtorAndStructConstraint.Test10), "Generic argument is an array of classes with default ctor", "E", "method1", "NonGenStruct[]"); - - Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "E", "method1", "GenClassWithCtor[System.Int32]"); - Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "E", "method1", "GenClassNoCtor[System.Int32]"); - Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test5), "Generic argument is a generic interface", "E", "method1", "GenInterface[System.Int32]"); - Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test7), "Generic argument is Nullable", "E", "method1", "System.Nullable`1[System.Int32]"); - - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_Constraints_Negative.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_Constraints_Negative.csproj deleted file mode 100644 index dbfebd583d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_Constraints_Negative.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Method_Constraints_Negative - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndClassConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndClassConstraint_Neg.il deleted file mode 100644 index ac585b387d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndClassConstraint_Neg.il +++ /dev/null @@ -1,213 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Method_DefaultCtorAndClassConstraint_Neg {} - - - -.class public auto ansi beforefieldinit D - extends [mscorlib]System.Object -{ - - // Generic method with class() and new() constraints - .method public hidebysig instance void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - - - -} - -.class public auto ansi beforefieldinit M_DefaultCtorAndClassConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1() - ret - } - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1() - - ret - } - - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1() - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1() - - ret - } - - - // NEGATIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1() - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1() - - ret - } - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1() - - ret - } - -} - -.class public auto ansi beforefieldinit M_DefaultCtorAndClassConstraintGenTypes - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1>() - ret - } - - - // NEGATIVE TEST - // generic argument is a generic struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1>() - - ret - } - - - // NEGATIVE TEST - // generic argument is an generic interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1>() - - ret - } - - - - // NEGATIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1>() - - - ret - } - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1>() - - ret - } - -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndClassConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndClassConstraint_Neg.ilproj deleted file mode 100644 index 7d3463cbcf..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndClassConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Method_DefaultCtorAndClassConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndStructConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndStructConstraint_Neg.il deleted file mode 100644 index 17b2cfde50..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndStructConstraint_Neg.il +++ /dev/null @@ -1,187 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Method_DefaultCtorAndStructConstraint_Neg {} - - - -.class public auto ansi beforefieldinit E - extends [mscorlib]System.Object -{ - - // Generic method with struct() and new() constraints - .method public hidebysig instance void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit M_DefaultCtorAndStructConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1() - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1() - - ret - } - - - // NEGATIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1() - ret - } - - - - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1() - - ret - } - - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1() - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1() - - ret - } - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1() - ret - } - - -} - -.class public auto ansi beforefieldinit M_DefaultCtorAndStructConstraintGenTypes - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1>() - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1>() - - ret - } - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1>() - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1>() - - ret - } - - - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndStructConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndStructConstraint_Neg.ilproj deleted file mode 100644 index 1e49b3a613..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorAndStructConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Method_DefaultCtorAndStructConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorConstraint_Neg.il deleted file mode 100644 index eaed96b0db..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorConstraint_Neg.il +++ /dev/null @@ -1,132 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Method_DefaultCtorConstraint_Neg {} - - -.class public auto ansi beforefieldinit A - extends [mscorlib]System.Object -{ - - // Generic method with new() constraint - .method public hidebysig instance void - method1<.ctor T>() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit M_DefaultCtorConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - newobj instance void class A::.ctor() - call instance void class A::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - newobj instance void class A::.ctor() - call instance void class A::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class A::.ctor() - call instance void class A::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class A::.ctor() - call instance void class A::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class A::.ctor() - call instance void class A::method1() - - ret - } - - -} - -.class public auto ansi beforefieldinit M_DefaultCtorConstraintGenTypes - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class A::.ctor() - call instance void class A::method1>() - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class A::.ctor() - call instance void class A::method1>() - - ret - } -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorConstraint_Neg.ilproj deleted file mode 100644 index 1ba82f71f9..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_DefaultCtorConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Method_DefaultCtorConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_StructConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_StructConstraint_Neg.il deleted file mode 100644 index 315cb05a21..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_StructConstraint_Neg.il +++ /dev/null @@ -1,182 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Method_StructConstraint_Neg {} - - - -.class public auto ansi beforefieldinit C - extends [mscorlib]System.Object -{ - - // Generic method with class() constraint - .method public hidebysig instance void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit M_StructConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1() - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1() - ret - } - - -} - -.class public auto ansi beforefieldinit M_StructConstraintGenTypes - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1>() - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - - newobj instance void class C::.ctor() - call instance void class C::method1>() - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1>() - - ret - } - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1>() - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_StructConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_StructConstraint_Neg.ilproj deleted file mode 100644 index 9b799cd78c..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/Method_StructConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Method_StructConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/app.config b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/app.config deleted file mode 100644 index e5622f77ad..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/app.config +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/project.json b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/project.json deleted file mode 100644 index fc8ccb4cc2..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/project.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1-rc2-23816", - "System.Collections": "4.0.10", - "System.Collections.NonGeneric": "4.0.1-rc2-23816", - "System.Collections.Specialized": "4.0.1-rc2-23816", - "System.ComponentModel": "4.0.1-rc2-23816", - "System.Console": "4.0.0-rc2-23816", - "System.Diagnostics.Process": "4.1.0-rc2-23816", - "System.Globalization": "4.0.10", - "System.Globalization.Calendars": "4.0.0", - "System.IO": "4.0.10", - "System.IO.FileSystem": "4.0.0", - "System.IO.FileSystem.Primitives": "4.0.0", - "System.Linq": "4.0.1-rc2-23816", - "System.Linq.Queryable": "4.0.1-rc2-23816", - "System.Reflection": "4.0.10", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.1.0-rc2-23816", - "System.Runtime.Extensions": "4.0.10", - "System.Runtime.Handles": "4.0.0", - "System.Runtime.InteropServices": "4.1.0-rc2-23816", - "System.Runtime.Loader": "4.0.0-rc2-23816", - "System.Text.Encoding": "4.0.10", - "System.Threading": "4.0.10", - "System.Threading.Thread": "4.0.0-rc2-23816", - "System.Xml.ReaderWriter": "4.0.11-rc2-23816", - "System.Xml.XDocument": "4.0.11-rc2-23816", - "System.Xml.XmlDocument": "4.0.1-rc2-23816", - "System.Xml.XmlSerializer": "4.0.11-rc2-23816" - }, - "frameworks": { - "dnxcore50": {} - }, - "runtimes": { - "win7-x86": {}, - "win7-x64": {}, - "ubuntu.14.04-x64": {}, - "osx.10.10-x64": {}, - "centos.7-x64": {}, - "rhel.7-x64": {}, - "debian.8.2-x64": {} - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/types.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/types.il deleted file mode 100644 index 53c0b9e255..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/types.il +++ /dev/null @@ -1,117 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} - -.assembly Types {} - -// class with public nullary ctor -.class public auto ansi beforefieldinit ClassWithCtor - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// generic class with public nullary ctor -.class public auto ansi beforefieldinit GenClassWithCtor - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -// class without public nullary ctor -.class public auto ansi beforefieldinit ClassNoCtor - extends [mscorlib]System.Object -{ -} - -// generic class without public nullary ctor -.class public auto ansi beforefieldinit GenClassNoCtor - extends [mscorlib]System.Object -{ -} - - -// struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit NonGenStruct - extends [mscorlib]System.ValueType -{ - .pack 0 - .size 1 -} - - - -// generic struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit GenStruct - extends [mscorlib]System.ValueType -{ - .pack 0 - .size 1 -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit NonGenInterface -{ -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit GenInterface -{ -} - - -.class public auto ansi sealed Enum1 - extends [mscorlib]System.Enum -{ - .field public specialname rtspecialname int32 value__ - .field public static literal valuetype Enum1 One = int32(0x00000000) -} - - -// doesn't have public parameterless constructor -.class public auto ansi sealed Delegate1 - extends [mscorlib]System.MulticastDelegate -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor(object 'object', - native int 'method') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void Invoke() runtime managed - { - } - - .method public hidebysig newslot virtual - instance class [mscorlib]System.IAsyncResult - BeginInvoke(class [mscorlib]System.AsyncCallback callback, - object 'object') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed - { - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/types.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/types.ilproj deleted file mode 100644 index e90ddd06ea..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Negative/types.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - types - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_ClassConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_ClassConstraint_Pos.il deleted file mode 100644 index ec498b24ef..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_ClassConstraint_Pos.il +++ /dev/null @@ -1,171 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Method_ClassConstraint_Pos {} - - - -.class public auto ansi beforefieldinit B - extends [mscorlib]System.Object -{ - - // Generic method with class() constraint - .method public hidebysig instance void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit M_ClassConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1() - ret - } - - // POSITIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1() - ret - } - - - // POSITIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1() - ret - } - - - - // POSITIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - newobj instance void class B::.ctor() - call instance void class B::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - newobj instance void class B::.ctor() - call instance void class B::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1() - - ret - } - - - -} - -.class public auto ansi beforefieldinit M_ClassConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1>() - - ret - } - - // POSITIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1>() - - ret - } - - - // POSITIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class B::.ctor() - call instance void class B::method1>() - - ret - } - - -} - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_ClassConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_ClassConstraint_Pos.ilproj deleted file mode 100644 index 0dea3bb999..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_ClassConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Method_ClassConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_Constraints_Positive.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_Constraints_Positive.cs deleted file mode 100644 index 9533f0a104..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_Constraints_Positive.cs +++ /dev/null @@ -1,158 +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. - -// POSITIVE TESTS -/* Test various combinations of constraints on methods -CONSTRAINTS: - -default ctor -reference type -valuetype -default ctor, reference tyoe -default ctor, valuetype - -Test each constraint with -- Class with default nullary ctor (Generic/Non generic) -- Class with no default nullary ctor (Generic/Non generic) -- Class from mscorlib with default nullary ctor -- Abstract Class from mscorlib with no default nullary ctor - -- Struct from mscorlib (Generic/Non generic) -- Struct (Generic/Non generic) -- Enum (Generic/Non generic) - -- Interface (Generic/Non generic) - -- Array - -- Delegate - -- Nullable -*/ - -using System; - - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - - static void Check(Case mytest, string testName, string violatingType, string type) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - - Console.WriteLine(" : PASS"); - return; - } - catch (TypeLoadException e) - { - Console.WriteLine("\nFAIL: Caught unexpected TypeLoadException: " + e); - pass = false; - return; - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - - public static int Main() - { - pass = true; - - Console.WriteLine("POSITIVE TESTS"); - - Console.WriteLine("\nType: A where T : new()\n"); - - Check(new Case(M_DefaultCtorConstraint.Test1), "Generic argument is a class with default ctor", "N/A", "N/A"); - Check(new Case(M_DefaultCtorConstraint.Test3), "Generic argument is a struct (valuetypes have public nullary ctors by default)", "N/A", "N/A"); - Check(new Case(M_DefaultCtorConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "N/A", "N/A"); - - // enum is a valueypte and all valuetypes have public nullary ctors. - Check(new Case(M_DefaultCtorConstraint.Test8), "Generic argument is an enum", "N/A", "N/A"); - - - Check(new Case(M_DefaultCtorConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "N/A", "N/A"); - Check(new Case(M_DefaultCtorConstraintGenTypes.Test3), "Generic argument is a generic struct", "N/A", "N/A"); - Check(new Case(M_DefaultCtorConstraintGenTypes.Test6), "Generic argument is Nullable", "N/A", "N/A"); - - - - Console.WriteLine("\nType: A where T : class()\n"); - - - Check(new Case(M_ClassConstraint.Test1), "Generic argument is a class with default ctor", "N/A", "N/A"); - Check(new Case(M_ClassConstraint.Test2), "Generic argument is a class with no default ctor", "N/A", "N/A"); - Check(new Case(M_ClassConstraint.Test4), "Generic argument is a delegate", "N/A", "N/A"); - Check(new Case(M_ClassConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "N/A", "N/A"); - Check(new Case(M_ClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "N/A", "N/A"); - Check(new Case(M_ClassConstraint.Test7), "Generic argument is an interface", "N/A", "N/A"); - - - Check(new Case(M_ClassConstraint.Test9), "Generic argument is an array of classes with default ctor", "N/A", "N/A"); - - Check(new Case(M_ClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "N/A", "N/A"); - Check(new Case(M_ClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "N/A", "N/A"); - Check(new Case(M_ClassConstraintGenTypes.Test5), "Generic argument is a generic interface", "N/A", "N/A"); - - Console.WriteLine("\nType: A where T : struct()\n"); - - - Check(new Case(M_StructConstraint.Test3), "Generic argument is a struct", "N/A", "N/A"); - Check(new Case(M_StructConstraint.Test8), "Generic argument is an enum", "N/A", "N/A"); - Check(new Case(M_StructConstraint.Test9), "Generic argument is an mscorlib struct", "N/A", "N/A"); - - Check(new Case(M_StructConstraintGenTypes.Test3), "Generic argument is a generic struct", "N/A", "N/A"); - Check(new Case(M_StructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "N/A", "N/A"); - - - - Console.WriteLine("\nType: A where T : class(), new() \n"); - - Check(new Case(M_DefaultCtorAndClassConstraint.Test1), "Generic argument is a class with default ctor", "N/A", "N/A"); - Check(new Case(M_DefaultCtorAndClassConstraint.Test5), "Generic argument is a is an mscorlib class with default ctor", "N/A", "N/A"); - Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "N/A", "N/A"); - - - - Console.WriteLine("\nType: A where T : struct(), new()\n"); - - - Check(new Case(M_DefaultCtorAndStructConstraint.Test3), "Generic argument is a struct", "N/A", "N/A"); - Check(new Case(M_DefaultCtorAndStructConstraint.Test9), "Generic argument is an mscorlib struct", "N/A", "N/A"); - Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test3), "Generic argument is a generic struct", "N/A", "N/A"); - Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "N/A", "N/A"); - Check(new Case(M_DefaultCtorAndStructConstraint.Test8), "Generic argument is an enum", "N/A", "N/A"); - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_Constraints_Positive.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_Constraints_Positive.csproj deleted file mode 100644 index 11baa29070..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_Constraints_Positive.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Method_Constraints_Positive - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndClassConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndClassConstraint_Pos.il deleted file mode 100644 index bdfe960750..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndClassConstraint_Pos.il +++ /dev/null @@ -1,82 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Method_DefaultCtorAndClassConstraint_Pos {} - - - -.class public auto ansi beforefieldinit D - extends [mscorlib]System.Object -{ - - // Generic method with class() and new() constraints - .method public hidebysig instance void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - - - -} - -.class public auto ansi beforefieldinit M_DefaultCtorAndClassConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1() - - ret - } - -} - -.class public auto ansi beforefieldinit M_DefaultCtorAndClassConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class D::.ctor() - call instance void class D::method1>() - - ret - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndClassConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndClassConstraint_Pos.ilproj deleted file mode 100644 index b4ff4c337d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndClassConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Method_DefaultCtorAndClassConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndStructConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndStructConstraint_Pos.il deleted file mode 100644 index c9b223f097..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndStructConstraint_Pos.il +++ /dev/null @@ -1,110 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Method_DefaultCtorAndStructConstraint_Pos {} - - - -.class public auto ansi beforefieldinit E - extends [mscorlib]System.Object -{ - - // Generic method with struct() and new() constraints - .method public hidebysig instance void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit M_DefaultCtorAndStructConstraint - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1() - - ret - } - - // POSITIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1() - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1() - ret - } - -} - -.class public auto ansi beforefieldinit M_DefaultCtorAndStructConstraintGenTypes - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1>() - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class E::.ctor() - call instance void class E::method1>() - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndStructConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndStructConstraint_Pos.ilproj deleted file mode 100644 index 958c9f1630..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorAndStructConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Method_DefaultCtorAndStructConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorConstraint_Pos.il deleted file mode 100644 index 71e7662830..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorConstraint_Pos.il +++ /dev/null @@ -1,134 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Method_DefaultCtorConstraint_Pos {} - - -.class public auto ansi beforefieldinit A - extends [mscorlib]System.Object -{ - - // Generic method with new() constraint - .method public hidebysig instance void - method1<.ctor T>() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit M_DefaultCtorConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - newobj instance void class A::.ctor() - call instance void class A::method1() - ret - } - - - // POSITIVE TEST - // generic argument is a struct (valuetypes have public nullary ctors by default) - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - newobj instance void class A::.ctor() - call instance void class A::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class A::.ctor() - call instance void class A::method1() - ret - } - - - - // POSITIVE TEST - // generic argument is an enum with no default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class A::.ctor() - call instance void class A::method1() - ret - } - - -} - -.class public auto ansi beforefieldinit M_DefaultCtorConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class A::.ctor() - call instance void class A::method1>() - ret - } - - - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class A::.ctor() - call instance void class A::method1>() - - ret - } - - - - // POSITIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class A::.ctor() - call instance void class A::method1>() - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorConstraint_Pos.ilproj deleted file mode 100644 index 12545dfb80..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_DefaultCtorConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Method_DefaultCtorConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_StructConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_StructConstraint_Pos.il deleted file mode 100644 index 284d48e0f4..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_StructConstraint_Pos.il +++ /dev/null @@ -1,112 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Method_StructConstraint_Pos {} - - - -.class public auto ansi beforefieldinit C - extends [mscorlib]System.Object -{ - - // Generic method with class() constraint - .method public hidebysig instance void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit M_StructConstraint - extends [mscorlib]System.Object -{ - - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1() - - ret - } - -} - -.class public auto ansi beforefieldinit M_StructConstraintGenTypes - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1>() - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class C::.ctor() - call instance void class C::method1>() - - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_StructConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_StructConstraint_Pos.ilproj deleted file mode 100644 index f16948d7e8..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/Method_StructConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Method_StructConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/app.config b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/app.config deleted file mode 100644 index e5622f77ad..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/app.config +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/project.json b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/project.json deleted file mode 100644 index a2e84dc340..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/project.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1-rc2-23816", - "System.Collections": "4.0.10", - "System.Collections.NonGeneric": "4.0.1-rc2-23816", - "System.Collections.Specialized": "4.0.1-rc2-23816", - "System.ComponentModel": "4.0.1-rc2-23816", - "System.Console": "4.0.0-rc2-23816", - "System.Diagnostics.Process": "4.1.0-rc2-23816", - "System.Globalization": "4.0.10", - "System.Globalization.Calendars": "4.0.0", - "System.IO": "4.0.10", - "System.IO.FileSystem": "4.0.0", - "System.IO.FileSystem.Primitives": "4.0.0", - "System.Linq": "4.0.1-rc2-23816", - "System.Linq.Queryable": "4.0.1-rc2-23816", - "System.Reflection": "4.0.10", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.1.0-rc2-23816", - "System.Runtime.Extensions": "4.0.10", - "System.Runtime.Handles": "4.0.0", - "System.Runtime.InteropServices": "4.1.0-rc2-23816", - "System.Runtime.Loader": "4.0.0-rc2-23816", - "System.Text.Encoding": "4.0.10", - "System.Threading": "4.0.10", - "System.Threading.Thread": "4.0.0-rc2-23816", - "System.Xml.ReaderWriter": "4.0.11-rc2-23816", - "System.Xml.XDocument": "4.0.11-rc2-23816", - "System.Xml.XmlDocument": "4.0.1-rc2-23816", - "System.Xml.XmlSerializer": "4.0.11-rc2-23816" - }, - "frameworks": { - "dnxcore50": {} - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/types.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/types.il deleted file mode 100644 index 53c0b9e255..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/types.il +++ /dev/null @@ -1,117 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} - -.assembly Types {} - -// class with public nullary ctor -.class public auto ansi beforefieldinit ClassWithCtor - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// generic class with public nullary ctor -.class public auto ansi beforefieldinit GenClassWithCtor - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -// class without public nullary ctor -.class public auto ansi beforefieldinit ClassNoCtor - extends [mscorlib]System.Object -{ -} - -// generic class without public nullary ctor -.class public auto ansi beforefieldinit GenClassNoCtor - extends [mscorlib]System.Object -{ -} - - -// struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit NonGenStruct - extends [mscorlib]System.ValueType -{ - .pack 0 - .size 1 -} - - - -// generic struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit GenStruct - extends [mscorlib]System.ValueType -{ - .pack 0 - .size 1 -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit NonGenInterface -{ -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit GenInterface -{ -} - - -.class public auto ansi sealed Enum1 - extends [mscorlib]System.Enum -{ - .field public specialname rtspecialname int32 value__ - .field public static literal valuetype Enum1 One = int32(0x00000000) -} - - -// doesn't have public parameterless constructor -.class public auto ansi sealed Delegate1 - extends [mscorlib]System.MulticastDelegate -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor(object 'object', - native int 'method') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void Invoke() runtime managed - { - } - - .method public hidebysig newslot virtual - instance class [mscorlib]System.IAsyncResult - BeginInvoke(class [mscorlib]System.AsyncCallback callback, - object 'object') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed - { - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/types.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/types.ilproj deleted file mode 100644 index e90ddd06ea..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnMethod/Positive/types.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - types - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_ClassConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_ClassConstraint_Neg.il deleted file mode 100644 index dfe74b8207..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_ClassConstraint_Neg.il +++ /dev/null @@ -1,87 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Instantiation_ClassConstraint_Neg {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit B`1 - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit ClassConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class B`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an enum with no default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class B`1::.ctor() - pop - - ret - } -} - -.class public auto ansi beforefieldinit ClassConstraintGenTypes - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class B`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class B`1>::.ctor() - pop - - ret - } -} - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_ClassConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_ClassConstraint_Neg.ilproj deleted file mode 100644 index cfb4c80e0c..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_ClassConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_ClassConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_Constraints_Neg.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_Constraints_Neg.cs deleted file mode 100644 index 0166e701e2..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_Constraints_Neg.cs +++ /dev/null @@ -1,187 +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. - -/* Test various combinations of constraints with illegal parameter types by instantiating the types - -CONSTRAINTS: - -default ctor -reference type -valuetype -default ctor, reference type -default ctor, valuetype - -Test each constraint with (whichever applies to negative tests) -- Class with default nullary ctor (Generic/Non generic) -- Class with no default nullary ctor (Generic/Non generic) -- Class from mscorlib with default nullary ctor -- Abstract Class from mscorlib with no default nullary ctor - -- Struct from mscorlib (Generic/Non generic) -- Struct (Generic/Non generic) -- Enum (Generic/Non generic) - -- Interface (Generic/Non generic) - -- Array - -- Delegate - -- Nullable - - - -*/ - -using System; - - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - - static void Check(Case mytest, string testName, string violatingType, string type) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException"); - pass = false; - } - catch (TypeLoadException e) - { - // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2' - // violates the constraint of type parameter '%3'. - - Test.CheckTypeLoadExceptionMessage(8310, e, violatingType, type); - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - public static void CheckTypeLoadExceptionMessage(uint ResourceID, TypeLoadException e, string violatingType, string type ) - { - if ( - !e.ToString().Contains("0") || - !e.ToString().Contains(violatingType) || - !e.ToString().Contains(type) || - !e.ToString().Contains("T")) - { - Console.WriteLine("Exception message is incorrect"); - pass = false; - } - else - { - Console.WriteLine("Caught expected exception"); - } - } - - - public static int Main() - { - pass = true; - - Console.WriteLine("\nType: A where T : new()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(DefaultCtorConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "A`1[T]"); - Check(new Case(DefaultCtorConstraint.Test4), "Generic argument is a delegate", "Delegate1", "A`1[T]"); - Check(new Case(DefaultCtorConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "A`1[T]"); - Check(new Case(DefaultCtorConstraint.Test7), "Generic argument is an interface with no default ctor", "NonGenInterface", "A`1[T]"); - Check(new Case(DefaultCtorConstraint.Test9), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "A`1[T]"); - Check(new Case(DefaultCtorConstraintGenTypes.Test2), " Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "A`1[T]"); - Check(new Case(DefaultCtorConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "A`1[T]"); - - - - Console.WriteLine("\nType: A where T : class()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(ClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "B`1[T]"); - Check(new Case(ClassConstraint.Test8), "Generic argument is an enum", "Enum1", "B`1[T]"); - Check(new Case(ClassConstraintGenTypes.Test3), "Generic argument is a generic struct with default ctor", "GenStruct[System.Int32]", "B`1[T]"); - Check(new Case(ClassConstraintGenTypes.Test6), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "B`1[T]"); - - - Console.WriteLine("\nType: A where T : struct()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(StructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "C`1[T]"); - Check(new Case(StructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "C`1[T]"); - Check(new Case(StructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "C`1[T]"); - Check(new Case(StructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "C`1[T]"); - Check(new Case(StructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "C`1[T]"); - Check(new Case(StructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "C`1[T]"); - Check(new Case(StructConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "C`1[T]"); - Check(new Case(StructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "C`1[T]"); - Check(new Case(StructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "C`1[T]"); - Check(new Case(StructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "C`1[T]"); - Check(new Case(StructConstraintGenTypes.Test7), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "C`1[T]"); - - - - Console.WriteLine("\nType: A where T : class(), new() \n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(DefaultCtorAndClassConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraint.Test4), "Generic argument is a delegate", "Delegate1", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraint.Test9), "Generic argument is an mscorlib struct", "System.DateTime", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraint.Test8), "Generic argument is an enum", "Enum1", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test3), "Generic argument is a generic struct", "GenStruct[System.Int32]", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "System.Collections.Generic.KeyValuePair`2[NonGenStruct,System.Int32]", "D`1[T]"); - Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test7), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "D`1[T]"); - - - Console.WriteLine("\nType: A where T : struct(), new()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(DefaultCtorAndStructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "E`1[T]"); - Check(new Case(DefaultCtorAndStructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "E`1[T]"); - Check(new Case(DefaultCtorAndStructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "E`1[T]"); - Check(new Case(DefaultCtorAndStructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "E`1[T]"); - Check(new Case(DefaultCtorAndStructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "E`1[T]"); - Check(new Case(DefaultCtorAndStructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "E`1[T]"); - Check(new Case(DefaultCtorAndStructConstraint.Test10), "Generic argument is an array of classes with default ctor", "NonGenStruct[]", "E`1[T]"); - Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "E`1[T]"); - Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "E`1[T]"); - Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "E`1[T]"); - Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test7), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "E`1[T]"); - - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_Constraints_Neg.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_Constraints_Neg.csproj deleted file mode 100644 index 19f8ea1469..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_Constraints_Neg.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Instantiation_Constraints_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassConstraint_Neg.il deleted file mode 100644 index 37f590114a..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassConstraint_Neg.il +++ /dev/null @@ -1,209 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Instantiation_DefaultCtorAndClassConstraint_Neg {} - - -// Generic class with class() and new() constraints -.class public auto ansi beforefieldinit D`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - - - -} - -.class public auto ansi beforefieldinit DefaultCtorAndClassConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - newobj instance void class D`1::.ctor() - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } -} - -.class public auto ansi beforefieldinit DefaultCtorAndClassConstraintGenTypes - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a generic struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an generic interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassConstraint_Neg.ilproj deleted file mode 100644 index c835970db4..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_DefaultCtorAndClassConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassTypeConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassTypeConstraint_Neg.il deleted file mode 100644 index 8cbb4d092c..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassTypeConstraint_Neg.il +++ /dev/null @@ -1,223 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types_implementI_extendC {} - -.assembly Instantiation_DefaultCtorAndClassTypeConstraint_Neg {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit F`1<.ctor ([types_implementI_extendC]C) T> - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - - - -.class public auto ansi beforefieldinit Instantiation_DefaultCtorAndClassTypeConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with default ctor that doesn't extend C - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an enum (has default ctor since it's a valuetype) - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test11() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a generic class with default ctor that implements I but doesn't extend C - .method public hidebysig static void Test12() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a struct (valuetypes have public nullary ctors by default) - .method public hidebysig static void Test13() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test14() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - - - - - - - - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassTypeConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassTypeConstraint_Neg.ilproj deleted file mode 100644 index 9d9f4959b9..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndClassTypeConstraint_Neg.ilproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Instantiation_DefaultCtorAndClassTypeConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndStructConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndStructConstraint_Neg.il deleted file mode 100644 index 7edb3d609b..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndStructConstraint_Neg.il +++ /dev/null @@ -1,178 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Instantiation_DefaultCtorAndStructConstraint_Neg {} - - -// Generic class with struct() and new() constraints -.class public auto ansi beforefieldinit E`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit DefaultCtorAndStructConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - newobj instance void class E`1::.ctor() - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } -} - -.class public auto ansi beforefieldinit DefaultCtorAndStructConstraintGenTypes - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndStructConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndStructConstraint_Neg.ilproj deleted file mode 100644 index e6068f0920..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorAndStructConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_DefaultCtorAndStructConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorConstraint_Neg.il deleted file mode 100644 index 60da97a375..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorConstraint_Neg.il +++ /dev/null @@ -1,146 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Instantiation_DefaultCtorConstraint_Neg {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit A`1<.ctor T> - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit DefaultCtorConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - - ret - } - - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - // generic argument is NUllable - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - -} - -.class public auto ansi beforefieldinit DefaultCtorConstraintGenTypes - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class A`1>::.ctor() - pop - - ret - } - - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class A`1>::.ctor() - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorConstraint_Neg.ilproj deleted file mode 100644 index 766a567ddc..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_DefaultCtorConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_DefaultCtorConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_StructConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_StructConstraint_Neg.il deleted file mode 100644 index 27f71b129b..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_StructConstraint_Neg.il +++ /dev/null @@ -1,176 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Instantiation_StructConstraint_Neg {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit C`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit StructConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class C`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class C`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class C`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class C`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - newobj instance void class C`1::.ctor() - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class C`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class C`1::.ctor() - pop - - ret - } -} - -.class public auto ansi beforefieldinit StructConstraintGenTypes - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class C`1>::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class C`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class C`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class C`1>::.ctor() - pop - - ret - } -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_StructConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_StructConstraint_Neg.ilproj deleted file mode 100644 index daad12889c..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Instantiation_StructConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_StructConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassConstraint_Neg.il deleted file mode 100644 index 6b794e184d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassConstraint_Neg.il +++ /dev/null @@ -1,189 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types_implementI{} - -.assembly Interface_DefaultCtorAndClassConstraint_Neg {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit D`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit Interface_DefaultCtorAndClassConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an enum (has default ctor since it's a valuetype) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a struct (valuetypes have public nullary ctors by default) - .method public hidebysig static void Test11() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test12() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassConstraint_Neg.ilproj deleted file mode 100644 index 40eb841f32..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Interface_DefaultCtorAndClassConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassTypeConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassTypeConstraint_Neg.il deleted file mode 100644 index 73f3f7529d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassTypeConstraint_Neg.il +++ /dev/null @@ -1,233 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types_implementI_extendC {} - -.assembly Interface_DefaultCtorAndClassTypeConstraint_Neg {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit F`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - - - -.class public auto ansi beforefieldinit Interface_DefaultCtorAndClassTypeConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with default ctor that implements I but doesn't extend C - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an enum (has default ctor since it's a valuetype) - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test11() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a generic class with default ctor that implements I but doesn't extend C - .method public hidebysig static void Test12() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a struct (valuetypes have public nullary ctors by default) - .method public hidebysig static void Test13() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test14() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a class with default ctor that doesn't implements I but extends C - .method public hidebysig static void Test15() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - - - - - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassTypeConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassTypeConstraint_Neg.ilproj deleted file mode 100644 index 402afc6280..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndClassTypeConstraint_Neg.ilproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Interface_DefaultCtorAndClassTypeConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndStructConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndStructConstraint_Neg.il deleted file mode 100644 index ea076ff329..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndStructConstraint_Neg.il +++ /dev/null @@ -1,190 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types_implementI{} - -.assembly Interface_DefaultCtorAndStructConstraint_Neg {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit E`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit Interface_DefaultCtorAndStructConstraint - extends [mscorlib]System.Object -{ - - - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an enum (has default ctor since it's a valuetype) - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test11() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test12() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndStructConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndStructConstraint_Neg.ilproj deleted file mode 100644 index 8804ce1fd6..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorAndStructConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Interface_DefaultCtorAndStructConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorConstraint_Neg.il deleted file mode 100644 index 5e3abe0975..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorConstraint_Neg.il +++ /dev/null @@ -1,165 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types_implementI{} - -.assembly Interface_DefaultCtorConstraint_Neg {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit A`1<.ctor ([types_implementI]I) T> - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit Interface_DefaultCtorConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an enum (has default ctor since it's a valuetype) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - -// NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class A`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class A`1>::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class A`1>::.ctor() - pop - - ret - } - - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorConstraint_Neg.ilproj deleted file mode 100644 index 9e9a1e7422..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Interface_DefaultCtorConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Interface_DefaultCtorConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg.il deleted file mode 100644 index a5c0ab1493..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg.il +++ /dev/null @@ -1,318 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib {} -.assembly extern TypeParam_Constraints_Neg {} -.assembly RunTestNeg {} - - -.class public auto ansi beforefieldinit GClass`2<(!U) T,class U> - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit GStruct`2<(!U) T, valuetype U> - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -.class public auto ansi beforefieldinit GNew`2<(!U) T,.ctor U> - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit GClassType`2<(!U) T,([TypeParam_Constraints_Neg]A) U> - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit GInterfaceType`2<(!U) T,([TypeParam_Constraints_Neg]I) U> - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// =============================================================================== - -.class public auto ansi beforefieldinit RunGClassTest - extends [mscorlib]System.Object -{ - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - newobj instance void class GClass`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - newobj instance void class GClass`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - newobj instance void class GClass`2::.ctor() - pop - ret - } - - - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - newobj instance void class GClass`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - newobj instance void class GClass`2::.ctor() - pop - ret - } -} - -// =============================================================================== - -.class public auto ansi beforefieldinit RunGStructTest - extends [mscorlib]System.Object -{ - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - newobj instance void class GStruct`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - newobj instance void class GStruct`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - newobj instance void class GStruct`2::.ctor() - pop - ret - } - - - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - newobj instance void class GStruct`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - newobj instance void class GStruct`2::.ctor() - pop - ret - } - -} - -// =============================================================================== - - -.class public auto ansi beforefieldinit RunGNewTest - extends [mscorlib]System.Object -{ - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - newobj instance void class GNew`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - newobj instance void class GNew`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - newobj instance void class GNew`2::.ctor() - pop - ret - } - - - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - newobj instance void class GNew`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - newobj instance void class GNew`2::.ctor() - pop - ret - } - -} - -// =============================================================================== - -.class public auto ansi beforefieldinit RunGClassTypeTest - extends [mscorlib]System.Object -{ - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - newobj instance void class GClassType`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - newobj instance void class GClassType`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - newobj instance void class GClassType`2::.ctor() - pop - ret - } - - - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - newobj instance void class GClassType`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - newobj instance void class GClassType`2::.ctor() - pop - ret - } - -} - -// =============================================================================== - -.class public auto ansi beforefieldinit RunGInterfaceTypeTest - extends [mscorlib]System.Object -{ - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - newobj instance void class GInterfaceType`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - newobj instance void class GInterfaceType`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - newobj instance void class GInterfaceType`2::.ctor() - pop - ret - } - - - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - newobj instance void class GInterfaceType`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - newobj instance void class GInterfaceType`2::.ctor() - pop - ret - } - -} - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg.ilproj deleted file mode 100644 index d347a1a2d5..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg.ilproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - RunTestNeg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg2.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg2.il deleted file mode 100644 index 90f076dfba..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg2.il +++ /dev/null @@ -1,504 +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. - -.assembly extern System.Console { } -// See test descriptions below - -.assembly extern mscorlib {} - -.assembly RunTestNeg2 {} - - -.class public auto ansi beforefieldinit A - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public sequential ansi sealed beforefieldinit S - extends [mscorlib]System.ValueType - implements I -{ - .pack 0 - .size 1 -} - - - - -.class interface public abstract auto ansi I {} - - - -.class private auto ansi beforefieldinit GClass`1 - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit GStruct`1 - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -.class public auto ansi beforefieldinit GNew`1<.ctor T> - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// ============================================================ - - -.class private auto ansi beforefieldinit G1`1 - extends class GClass`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -.class private auto ansi beforefieldinit G2`1<(I) P> - extends class GClass`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class private auto ansi beforefieldinit G3`1<([mscorlib]System.Object) P> - extends class GClass`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class private auto ansi beforefieldinit G4`1<([mscorlib]System.ValueType) P> - extends class GClass`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -.class private auto ansi beforefieldinit G5`1<([mscorlib]System.Enum) P> - extends class GClass`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - // ============================================================ - - -.class private auto ansi beforefieldinit G6`1 - extends class GStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class private auto ansi beforefieldinit G7`1<(A) P> - extends class GStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -.class private auto ansi beforefieldinit G8`1<(I) P> - extends class GStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class private auto ansi beforefieldinit G12`1<(System.ValueType) P> - extends class GStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class private auto ansi beforefieldinit G13`1<(valuetype [mscorlib]System.'Nullable`1') P> - extends class GStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - - // ============================================================ - -.class public auto ansi beforefieldinit G9`1<(A) P> - extends class GNew`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit G10`1 - extends class GNew`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit G11`1<(I) P> - extends class GNew`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - // ============================================================ - -.class public auto ansi beforefieldinit RunTest - extends [mscorlib]System.Object -{ - - // TEST 1 - // NEGATIVE - // T has 'class' constraint BUT - // P has 'struct' constraint - // use a class as type param - .method public hidebysig static void Test1() cil managed - { - - .maxstack 1 - newobj instance void class G1`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 2 - // NEGATIVE - // T has 'class' constraint BUT - // P has 'struct' constraint - // use a struct as type param - .method public hidebysig static void Test2() cil managed - { - - .maxstack 1 - newobj instance void class G1`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 3 - // NEGATIVE - // T has 'class' constraint BUT - // P has interface-type constraint - // This is a secondary constraint - this tells us nothing about the eventual instantiation that - // we can use here. - - .method public hidebysig static void Test3() cil managed - { - - .maxstack 1 - newobj instance void class G2`1::.ctor() - pop - ret - } - - - // ===================================================================== - - // TEST 4 - // NEGATIVE - // T has 'class' constraint BUT - // P has System.Object constraint - .method public hidebysig static void Test4() cil managed - { - - .maxstack 1 - newobj instance void class G3`1::.ctor() - pop - ret - } - - - // ===================================================================== - - // TEST 5 - // NEGATIVE - // T has 'class' constraint BUT - // P has System.ValueType constraint - .method public hidebysig static void Test5() cil managed - { - - .maxstack 1 - newobj instance void class G4`1::.ctor() - pop - ret - } - - - // ===================================================================== - - // TEST 6 - // NEGATIVE - // T has 'class' constraint BUT - // P has System.Enum constraint - .method public hidebysig static void Test6() cil managed - { - - .maxstack 1 - newobj instance void class G5`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 7 - // NEGATIVE - // T has 'struct' constraint BUT - // P has 'class' constraint - // instantiated with a class - .method public hidebysig static void Test7() cil managed - { - - .maxstack 1 - newobj instance void class G6`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 8 - // NEGATIVE - // T has 'struct' constraint BUT - // P has 'class' constraint - // instantiated with a struct - .method public hidebysig static void Test8() cil managed - { - - .maxstack 1 - newobj instance void class G6`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 9 - // NEGATIVE - // T has 'struct' constraint BUT - // P has 'class-type' constraint - .method public hidebysig static void Test9() cil managed - { - - .maxstack 1 - newobj instance void class G7`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 10 - // NEGATIVE - // T has 'struct' constraint BUT - // P has 'interface-type' constraint - .method public hidebysig static void Test10() cil managed - { - - .maxstack 1 - newobj instance void class G8`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 11 - // NEGATIVE - // T has 'new' constraint BUT - // P has 'class-type' constraint - // Since constraints are not inherited this is a negative test because P doesn't have new constraint - // and since not all reference types have default ctor we do not accept this constraint. - .method public hidebysig static void Test11() cil managed - { - - .maxstack 1 - newobj instance void class G9`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 12 - // NEGATIVE - // T has 'new' constraint BUT - // P has 'class' constraint - .method public hidebysig static void Test12() cil managed - { - - .maxstack 1 - newobj instance void class G10`1::.ctor() - pop - ret - } - - - // ===================================================================== - - // TEST 13 - // NEGATIVE - // T has 'new' constraint BUT - // P has 'interface-type' constraint - .method public hidebysig static void Test13() cil managed - { - - .maxstack 1 - newobj instance void class G11`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 14 - // NEGATIVE - // T has 'struct' constraint BUT - // P has 'System.ValueType' constraint - .method public hidebysig static void Test14() cil managed - { - - .maxstack 1 - newobj instance void class G12`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 15 - // NEGATIVE - // T has 'struct'Nullable' constraint - .method public hidebysig static void Test15() cil managed - { - - .maxstack 1 - newobj instance void class G12`1>::.ctor() - pop - ret - } - -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg2.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg2.ilproj deleted file mode 100644 index c77596dbb6..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg2.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - RunTestNeg2 - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg3.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg3.il deleted file mode 100644 index 403c9f1505..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg3.il +++ /dev/null @@ -1,484 +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. - -.assembly extern System.Console { } - -// See test descriptions below - -.assembly extern mscorlib {} - -.assembly RunTestNeg3 {} - - -.class public auto ansi beforefieldinit A - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public sequential ansi sealed beforefieldinit S - extends [mscorlib]System.ValueType - implements I -{ - .pack 0 - .size 1 -} - - - - -.class interface public abstract auto ansi I {} - - - -.class interface public abstract auto ansi IClass`1 {} - -.class interface public abstract auto ansi IStruct`1 {} - -.class interface public abstract auto ansi INew`1<.ctor T> {} - -// ============================================================ - - -.class private auto ansi beforefieldinit G1`1 - extends [mscorlib]System.Object - implements class IClass`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -.class private auto ansi beforefieldinit G2`1<(I) P> - extends [mscorlib]System.Object - implements class IClass`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class private auto ansi beforefieldinit G3`1<([mscorlib]System.Object) P> - extends [mscorlib]System.Object - implements class IClass`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class private auto ansi beforefieldinit G4`1<([mscorlib]System.ValueType) P> - extends [mscorlib]System.Object - implements class IClass`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -.class private auto ansi beforefieldinit G5`1<([mscorlib]System.Enum) P> - extends [mscorlib]System.Object - implements class IClass`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - // ============================================================ - -.class private auto ansi beforefieldinit G6`1 - extends [mscorlib]System.Object - implements class IStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class private auto ansi beforefieldinit G7`1<(A) P> - extends [mscorlib]System.Object - implements class IStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -.class private auto ansi beforefieldinit G8`1<(I) P> - extends [mscorlib]System.Object - implements class IStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -.class private auto ansi beforefieldinit G12`1<(System.ValueType) P> - extends [mscorlib]System.Object - implements class IStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class private auto ansi beforefieldinit G13`1<(valuetype [mscorlib]System.'Nullable`1') P> - extends [mscorlib]System.Object - implements class IStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - // ============================================================ - -.class public auto ansi beforefieldinit G9`1<(A) P> - extends [mscorlib]System.Object - implements class INew`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit G10`1 - extends [mscorlib]System.Object - implements class INew`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit G11`1<(I) P> - extends [mscorlib]System.Object - implements class INew`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - - - // ============================================================ - -.class public auto ansi beforefieldinit RunTest - extends [mscorlib]System.Object -{ - - // TEST 1 - // NEGATIVE - // T has 'class' constraint BUT - // P has 'struct' constraint - // use a class as type param - .method public hidebysig static void Test1() cil managed - { - - .maxstack 1 - newobj instance void class G1`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 2 - // NEGATIVE - // T has 'class' constraint BUT - // P has 'struct' constraint - // use a struct as type param - .method public hidebysig static void Test2() cil managed - { - - .maxstack 1 - newobj instance void class G1`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 3 - // NEGATIVE - // T has 'class' constraint BUT - // P has interface-type constraint - // This is a secondary constraint - this tells us nothing about the eventual instantiation that - // we can use here. - - .method public hidebysig static void Test3() cil managed - { - - .maxstack 1 - newobj instance void class G2`1::.ctor() - pop - ret - } - - - // ===================================================================== - - // TEST 4 - // NEGATIVE - // T has 'class' constraint BUT - // P has System.Object constraint - .method public hidebysig static void Test4() cil managed - { - - .maxstack 1 - newobj instance void class G3`1::.ctor() - pop - ret - } - - - // ===================================================================== - - // TEST 5 - // NEGATIVE - // T has 'class' constraint BUT - // P has System.ValueType constraint - .method public hidebysig static void Test5() cil managed - { - - .maxstack 1 - newobj instance void class G4`1::.ctor() - pop - ret - } - - - // ===================================================================== - - // TEST 6 - // NEGATIVE - // T has 'class' constraint BUT - // P has System.Enum constraint - .method public hidebysig static void Test6() cil managed - { - - .maxstack 1 - newobj instance void class G5`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 7 - // NEGATIVE - // T has 'struct' constraint BUT - // P has 'class' constraint - // instantiated with a class - .method public hidebysig static void Test7() cil managed - { - - .maxstack 1 - newobj instance void class G6`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 8 - // NEGATIVE - // T has 'struct' constraint BUT - // P has 'class' constraint - // instantiated with a struct - .method public hidebysig static void Test8() cil managed - { - - .maxstack 1 - newobj instance void class G6`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 9 - // NEGATIVE - // T has 'struct' constraint BUT - // P has 'class-type' constraint - .method public hidebysig static void Test9() cil managed - { - - .maxstack 1 - newobj instance void class G7`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 10 - // NEGATIVE - // T has 'struct' constraint BUT - // P has 'interface-type' constraint - .method public hidebysig static void Test10() cil managed - { - - .maxstack 1 - newobj instance void class G8`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 11 - // NEGATIVE - // T has 'new' constraint BUT - // P has 'class-type' constraint - // Since constraints are not inherited this is a negative test because P doesn't have new constraint - // and since not all reference types have default ctor we do not accept this constraint. - .method public hidebysig static void Test11() cil managed - { - - .maxstack 1 - newobj instance void class G9`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 12 - // NEGATIVE - // T has 'new' constraint BUT - // P has 'class' constraint - .method public hidebysig static void Test12() cil managed - { - - .maxstack 1 - newobj instance void class G10`1::.ctor() - pop - ret - } - - - // ===================================================================== - - // TEST 13 - // NEGATIVE - // T has 'new' constraint BUT - // P has 'interface-type' constraint - .method public hidebysig static void Test13() cil managed - { - - .maxstack 1 - newobj instance void class G11`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 14 - // NEGATIVE - // T has 'struct' constraint BUT - // P has 'System.ValueType' constraint - .method public hidebysig static void Test14() cil managed - { - - .maxstack 1 - newobj instance void class G12`1::.ctor() - pop - ret - } - - // ===================================================================== - - // TEST 15 - // NEGATIVE - // T has 'struct'Nullable' constraint - .method public hidebysig static void Test15() cil managed - { - - .maxstack 1 - newobj instance void class G12`1>::.ctor() - pop - ret - } -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg3.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg3.ilproj deleted file mode 100644 index c7845e854a..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/RunTestNeg3.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - RunTestNeg3 - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Secondary_Ctor_Constraints_Type_Negative.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Secondary_Ctor_Constraints_Type_Negative.cs deleted file mode 100644 index 769235f9a3..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Secondary_Ctor_Constraints_Type_Negative.cs +++ /dev/null @@ -1,208 +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. - -// NEGATIVE TESTS -/* - -The following constraint combinations are tested: - -- Interface-type, New() -- class, Interface-type, New() -- struct, Interface-type, New() -- Class-type, Interface-type, New() -- Class-type, New() - - -Each is tested with type parameter (whichever is valid in negative tests): -- Class with default nullary ctor (Generic/Non generic) -- Class with no default nullary ctor (Generic/Non generic) -- Class from mscorlib with default nullary ctor -- Abstract Class from mscorlib with no default nullary ctor - -- Struct from mscorlib (Generic/Non generic) -- Struct (Generic/Non generic) -- Enum (Generic/Non generic) - -- Interface (Generic/Non generic) - -- Array - -- Delegate - -- Nullable -*/ - -using System; -using System.Security; - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - - static void Check(Case mytest, string testName, string violatingType, string type) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException"); - pass = false; - } - catch (TypeLoadException e) - { - // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2' - // violates the constraint of type parameter '%3'. - - Test.CheckTypeLoadExceptionMessage(8310, e, violatingType, type); - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - public static void CheckTypeLoadExceptionMessage(uint ResourceID, TypeLoadException e, string violatingType, string type ) - { - if ( - !e.ToString().Contains("0") || - !e.ToString().Contains(violatingType) || - !e.ToString().Contains(type) || - !e.ToString().Contains("T")) - { - Console.WriteLine("Exception message is incorrect"); - pass = false; - } - else - { - Console.WriteLine("Caught expected exception"); - } - } - - - - - public static int Main() - { - pass = true; - - Console.WriteLine("\nNEGATIVE TESTS"); - - Console.WriteLine("\nType: A where T : I, new()\n"); - - - Check(new Case(Interface_DefaultCtorConstraint.Test1), "Generic argument is a class with no default ctor", "ClassNoCtor", "A`1[T]"); - Check(new Case(Interface_DefaultCtorConstraint .Test2), "Generic argument is an mscorlib class with default ctor", "System.Object", "A`1[T]"); - Check(new Case(Interface_DefaultCtorConstraint.Test3), "Generic argument is a delegate", "Delegate1", "A`1[T]"); - Check(new Case(Interface_DefaultCtorConstraint .Test4), "Generic argument is an enum", "Enum1", "A`1[T]"); - Check(new Case(Interface_DefaultCtorConstraint.Test5), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "A`1[T]"); - Check(new Case(Interface_DefaultCtorConstraint.Test6), "Generic argument is an interface with no default ctor", "NonGenInterface", "A`1[T]"); - - Check(new Case(Interface_DefaultCtorConstraint.Test7), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "A`1[T]"); - - Check(new Case(Interface_DefaultCtorConstraint.Test8), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "A`1[T]"); - Check(new Case(Interface_DefaultCtorConstraint.Test9), "Generic argument is a generic interface", "GenInterface[System.Int32]", "A`1[T]"); - Check(new Case(Interface_DefaultCtorConstraint.Test10), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "A`1[T]"); - - Console.WriteLine("\nType: A where T : class, I, new() \n"); - - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test1), "Generic argument is a class with no default ctor", "ClassNoCtor", "D`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test2), "Generic argument is an mscorlib class with default ctor", "System.Object", "D`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test3), "Generic argument is a delegate", "Delegate1", "D`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test4), "Generic argument is an enum", "Enum1", "D`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test5), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "D`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test6), "Generic argument is an interface with no default ctor", "NonGenInterface", "D`1[T]"); - - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test7), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "D`1[T]"); - - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test8), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "D`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test9), "Generic argument is a generic interface", "GenInterface[System.Int32]", "D`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test10), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "D`1[T]"); - - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test11), "Generic argument is a struct", "NonGenStruct", "D`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassConstraint.Test12), "Generic argument is a generic struct", "GenStruct[System.Int32]", "D`1[T]"); - - - Console.WriteLine("\nType: A where T : struct, I, new()\n"); - - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test3), "Generic argument is an mscorlib class with default ctor", "System.Object", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test5), "Generic argument is an enum", "Enum1", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test8), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test9), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test10), "Generic argument is a generic interface", "GenInterface[System.Int32]", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test11), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "E`1[T]"); - Check(new Case(Interface_DefaultCtorAndStructConstraint.Test12), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "E`1[T]"); - - - Console.WriteLine("\nType: A where T : C, I, new()\n"); - - - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test1), "Generic argument is a class with default ctor, implements I, doesn't extend C", "ClassWithCtor", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test15), "Generic argument is a class with default ctor, doesn't implement I but extends C", "ClassWithCtor2", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test3), "Generic argument is an mscorlib class with default ctor", "System.Object", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test4), "Generic argument is a delegate", "Delegate1", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test5), "Generic argument is an enum", "Enum1", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test8), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test9), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test10), "Generic argument is a generic interface", "GenInterface[System.Int32]", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test11), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test12), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test13), "Generic argument is a struct", "NonGenStruct", "F`1[T]"); - Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test14), "Generic argument is a generic struct", "GenStruct[System.Int32]", "F`1[T]"); - - - - Console.WriteLine("\nType: A where T : C, new()\n"); - - - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test1), "Generic argument is a class with default ctor, implements I, doesn't extend C", "ClassWithCtor", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test3), "Generic argument is an mscorlib class with default ctor", "System.Object", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test4), "Generic argument is a delegate", "Delegate1", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test5), "Generic argument is an enum", "Enum1", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test8), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test9), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test10), "Generic argument is a generic interface", "GenInterface[System.Int32]", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test11), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test12), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test13), "Generic argument is a struct", "NonGenStruct", "F`1[T]"); - Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test14), "Generic argument is a generic struct", "GenStruct[System.Int32]", "F`1[T]"); - - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Secondary_Ctor_Constraints_Type_Negative.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Secondary_Ctor_Constraints_Type_Negative.csproj deleted file mode 100644 index 40544b9c25..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/Secondary_Ctor_Constraints_Type_Negative.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Secondary_Ctor_Constraints_Type_Negative - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_ClassConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_ClassConstraint_Neg.il deleted file mode 100644 index d7aa60f65f..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_ClassConstraint_Neg.il +++ /dev/null @@ -1,93 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticField_ClassConstraint_Neg {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit B`1 - extends [mscorlib]System.Object -{ - - .field public static int32 i - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SF_ClassConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an enum with no default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1::i - pop - - ret - } -} - -.class public auto ansi beforefieldinit SF_ClassConstraintGenTypes - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1>::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1>::i - pop - - ret - } -} - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_ClassConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_ClassConstraint_Neg.ilproj deleted file mode 100644 index 45854bf958..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_ClassConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticField_ClassConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_Constraints_Neg.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_Constraints_Neg.cs deleted file mode 100644 index a873c899f0..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_Constraints_Neg.cs +++ /dev/null @@ -1,187 +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. - -/* Test various combinations of constraints with illegal parameter types accessing static field of the generic type - -CONSTRAINTS: - -default ctor -reference type -valuetype -default ctor, reference tyoe -default ctor, valuetype - -Test each constraint with (whichever applies to negative tests) -- Class with default nullary ctor (Generic/Non generic) -- Class with no default nullary ctor (Generic/Non generic) -- Class from mscorlib with default nullary ctor -- Abstract Class from mscorlib with no default nullary ctor - -- Struct from mscorlib (Generic/Non generic) -- Struct (Generic/Non generic) -- Enum (Generic/Non generic) - -- Interface (Generic/Non generic) - -- Array - -- Delegate - -- Nullable - -*/ - -using System; - - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - - static void Check(Case mytest, string testName, string violatingType, string type) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException"); - pass = false; - } - catch (TypeLoadException e) - { - // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2' - // violates the constraint of type parameter '%3'. - - Test.CheckTypeLoadExceptionMessage(8310, e, violatingType, type); - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - public static void CheckTypeLoadExceptionMessage(uint ResourceID, TypeLoadException e, string violatingType, string type ) - { - if ( - !e.ToString().Contains("0") || - !e.ToString().Contains(violatingType) || - !e.ToString().Contains(type) || - !e.ToString().Contains("T")) - { - Console.WriteLine("Exception message is incorrect"); - pass = false; - } - else - { - Console.WriteLine("Caught expected exception"); - } - } - - public static int Main() - { - pass = true; - - Console.WriteLine("\nType: A where T : new()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(SF_DefaultCtorConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "A`1[T]"); - Check(new Case(SF_DefaultCtorConstraint.Test4), "Generic argument is a delegate", "Delegate1", "A`1[T]"); - Check(new Case(SF_DefaultCtorConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "A`1[T]"); - Check(new Case(SF_DefaultCtorConstraint.Test7), "Generic argument is an interface with no default ctor", "NonGenInterface", "A`1[T]"); - Check(new Case(SF_DefaultCtorConstraint.Test9), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "A`1[T]"); - Check(new Case(SF_DefaultCtorConstraintGenTypes.Test2), " Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "A`1[T]"); - Check(new Case(SF_DefaultCtorConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "A`1[T]"); - - - Console.WriteLine("\nType: A where T : class()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(SF_ClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "B`1[T]"); - Check(new Case(SF_ClassConstraint.Test8), "Generic argument is an enum", "Enum1", "B`1[T]"); - Check(new Case(SF_ClassConstraintGenTypes.Test3), "Generic argument is a generic struct with default ctor", "GenStruct[System.Int32]", "B`1[T]"); - Check(new Case(SF_ClassConstraintGenTypes.Test6), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "B`1[T]"); - - Console.WriteLine("\nType: A where T : struct()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(SF_StructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "C`1[T]"); - Check(new Case(SF_StructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "C`1[T]"); - Check(new Case(SF_StructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "C`1[T]"); - Check(new Case(SF_StructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "C`1[T]"); - Check(new Case(SF_StructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "C`1[T]"); - Check(new Case(SF_StructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "C`1[T]"); - Check(new Case(SF_StructConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "C`1[T]"); - - Check(new Case(SF_StructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "C`1[T]"); - Check(new Case(SF_StructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "C`1[T]"); - Check(new Case(SF_StructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "C`1[T]"); - Check(new Case(SF_StructConstraintGenTypes.Test7), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "C`1[T]"); - - - Console.WriteLine("\nType: A where T : class(), new() \n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(SF_DefaultCtorAndClassConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraint.Test4), "Generic argument is a delegate", "Delegate1", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraint.Test9), "Generic argument is an mscorlib struct", "System.DateTime", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraint.Test8), "Generic argument is an enum", "Enum1", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "D`1[T]"); - - - Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test3), "Generic argument is a generic struct", "GenStruct[System.Int32]", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "System.Collections.Generic.KeyValuePair`2[NonGenStruct,System.Int32]", "D`1[T]"); - Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test7), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "D`1[T]"); - - - Console.WriteLine("\nType: A where T : struct(), new()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(SF_DefaultCtorAndStructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "E`1[T]"); - Check(new Case(SF_DefaultCtorAndStructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "E`1[T]"); - Check(new Case(SF_DefaultCtorAndStructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "E`1[T]"); - Check(new Case(SF_DefaultCtorAndStructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "E`1[T]"); - Check(new Case(SF_DefaultCtorAndStructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "E`1[T]"); - Check(new Case(SF_DefaultCtorAndStructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "E`1[T]"); - - Check(new Case(SF_DefaultCtorAndStructConstraint.Test10), "Generic argument is an array of classes with default ctor", "NonGenStruct[]", "E`1[T]"); - - - Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "E`1[T]"); - Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "E`1[T]"); - Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "E`1[T]"); - Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test7), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "E`1[T]"); - - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_Constraints_Neg.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_Constraints_Neg.csproj deleted file mode 100644 index da81447f11..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_Constraints_Neg.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - StaticField_Constraints_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndClassConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndClassConstraint_Neg.il deleted file mode 100644 index 038ca345c6..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndClassConstraint_Neg.il +++ /dev/null @@ -1,218 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticField_DefaultCtorAndClassConstraint_Neg {} - - -// Generic class with class() and new() constraints -.class public auto ansi beforefieldinit D`1 - extends [mscorlib]System.Object -{ - - .field public static int32 i - - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - - - -} - -.class public auto ansi beforefieldinit SF_DefaultCtorAndClassConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1::i - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - ldsfld int32 class D`1::i - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1::i - pop - - ret - } - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1::i - pop - - ret - } - - - -} - -.class public auto ansi beforefieldinit SF_DefaultCtorAndClassConstraintGenTypes - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1>::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a generic struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1>::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an generic interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1>::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - ldsfld int32 class D`1>::i - - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1>::i - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndClassConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndClassConstraint_Neg.ilproj deleted file mode 100644 index f2ad4d0df3..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndClassConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticField_DefaultCtorAndClassConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndStructConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndStructConstraint_Neg.il deleted file mode 100644 index 8c1743f6c3..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndStructConstraint_Neg.il +++ /dev/null @@ -1,181 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticField_DefaultCtorAndStructConstraint_Neg {} - - -// Generic class with struct() and new() constraints -.class public auto ansi beforefieldinit E`1 - extends [mscorlib]System.Object -{ - - .field public static int32 i - - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SF_DefaultCtorAndStructConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1::i - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - ldsfld int32 class E`1::i - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1::i - pop - - ret - } -} - -.class public auto ansi beforefieldinit SF_DefaultCtorAndStructConstraintGenTypes - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1>::i - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1>::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1>::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1>::i - pop - - ret - } -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndStructConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndStructConstraint_Neg.ilproj deleted file mode 100644 index 768aa07c45..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorAndStructConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticField_DefaultCtorAndStructConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorConstraint_Neg.il deleted file mode 100644 index 9f801f901a..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorConstraint_Neg.il +++ /dev/null @@ -1,131 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticField_DefaultCtorConstraint_Neg {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit A`1<.ctor T> - extends [mscorlib]System.Object -{ - - .field public static int32 i - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit SF_DefaultCtorConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1::i - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1::i - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1::i - pop - - ret - } -} - -.class public auto ansi beforefieldinit SF_DefaultCtorConstraintGenTypes - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1>::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1>::i - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorConstraint_Neg.ilproj deleted file mode 100644 index e8b47315cf..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_DefaultCtorConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticField_DefaultCtorConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_StructConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_StructConstraint_Neg.il deleted file mode 100644 index 061256f5bc..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_StructConstraint_Neg.il +++ /dev/null @@ -1,179 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticField_StructConstraint_Neg {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit C`1 - extends [mscorlib]System.Object -{ - .field public static int32 i - - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SF_StructConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1::i - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1::i - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1::i - pop - - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - ldsfld int32 class C`1::i - pop - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1::i - pop - - ret - } -} - -.class public auto ansi beforefieldinit SF_StructConstraintGenTypes - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1>::i - pop - - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1>::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1>::i - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1>::i - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_StructConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_StructConstraint_Neg.ilproj deleted file mode 100644 index c883ffdbb6..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticField_StructConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticField_StructConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_ClassConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_ClassConstraint_Neg.il deleted file mode 100644 index e1b19d019a..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_ClassConstraint_Neg.il +++ /dev/null @@ -1,87 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticMethod_ClassConstraint_Neg {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit B`1 - extends [mscorlib]System.Object -{ - - .method public static hidebysig void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SM_ClassConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - call void class B`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an enum with no default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - call void class B`1::method1() - ret - } -} - -.class public auto ansi beforefieldinit SM_ClassConstraintGenTypes - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - call void class B`1>::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - call void class B`1>::method1() - ret - } -} - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_ClassConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_ClassConstraint_Neg.ilproj deleted file mode 100644 index 6a671d9102..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_ClassConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticMethod_ClassConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_Constraints_Neg.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_Constraints_Neg.cs deleted file mode 100644 index 4bb2c78bb0..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_Constraints_Neg.cs +++ /dev/null @@ -1,181 +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. - -/* Test various combinations of constraints with illegal parameter types by invoking static method on the generic type -CONSTRAINTS: - -default ctor -reference type -valuetype -default ctor, reference tyoe -default ctor, valuetype - -Test each constraint with (whichever applies to negative testing) -- Class with default nullary ctor (Generic/Non generic) -- Class with no default nullary ctor (Generic/Non generic) -- Class from mscorlib with default nullary ctor -- Abstract Class from mscorlib with no default nullary ctor - -- Struct from mscorlib (Generic/Non generic) -- Struct (Generic/Non generic) -- Enum (Generic/Non generic) - -- Interface (Generic/Non generic) - -- Array - -- Delegate - -- Nullable -*/ - -using System; - - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - - static void Check(Case mytest, string testName, string violatingType, string type) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException"); - pass = false; - } - catch (TypeLoadException e) - { - // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2' - // violates the constraint of type parameter '%3'. - - Test.CheckTypeLoadExceptionMessage(8310, e, violatingType, type); - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - public static void CheckTypeLoadExceptionMessage(uint ResourceID, TypeLoadException e, string violatingType, string type ) - { - if ( - !e.ToString().Contains("0") || - !e.ToString().Contains(violatingType) || - !e.ToString().Contains(type) || - !e.ToString().Contains("T")) - { - Console.WriteLine("Exception message is incorrect"); - pass = false; - } - else - { - Console.WriteLine("Caught expected exception"); - } - } - - - public static int Main() - { - pass = true; - - Console.WriteLine("\nType: A where T : new()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(SM_DefaultCtorConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "A`1[T]"); - Check(new Case(SM_DefaultCtorConstraint.Test4), "Generic argument is a delegate", "Delegate1", "A`1[T]"); - Check(new Case(SM_DefaultCtorConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "A`1[T]"); - Check(new Case(SM_DefaultCtorConstraint.Test7), "Generic argument is an interface with no default ctor", "NonGenInterface", "A`1[T]"); - Check(new Case(SM_DefaultCtorConstraint.Test9), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "A`1[T]"); - Check(new Case(SM_DefaultCtorConstraintGenTypes.Test2), " Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "A`1[T]"); - Check(new Case(SM_DefaultCtorConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "A`1[T]"); - - - Console.WriteLine("\nType: A where T : class()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(SM_ClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "B`1[T]"); - Check(new Case(SM_ClassConstraint.Test8), "Generic argument is an enum", "Enum1", "B`1[T]"); - Check(new Case(SM_ClassConstraintGenTypes.Test3), "Generic argument is a generic struct with default ctor", "GenStruct[System.Int32]", "B`1[T]"); - Check(new Case(SM_ClassConstraintGenTypes.Test6), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "B`1[T]"); - - Console.WriteLine("\nType: A where T : struct()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(SM_StructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "C`1[T]"); - Check(new Case(SM_StructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "C`1[T]"); - Check(new Case(SM_StructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "C`1[T]"); - Check(new Case(SM_StructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "C`1[T]"); - Check(new Case(SM_StructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "C`1[T]"); - Check(new Case(SM_StructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "C`1[T]"); - Check(new Case(SM_StructConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "C`1[T]"); - Check(new Case(SM_StructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "C`1[T]"); - Check(new Case(SM_StructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "C`1[T]"); - Check(new Case(SM_StructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "C`1[T]"); - Check(new Case(SM_StructConstraintGenTypes.Test7), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "C`1[T]"); - - - - Console.WriteLine("\nType: A where T : class(), new() \n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(SM_DefaultCtorAndClassConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraint.Test4), "Generic argument is a delegate", "Delegate1", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraint.Test9), "Generic argument is an mscorlib struct", "System.DateTime", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraint.Test8), "Generic argument is an enum", "Enum1", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test3), "Generic argument is a generic struct", "GenStruct[System.Int32]", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "System.Collections.Generic.KeyValuePair`2[NonGenStruct,System.Int32]", "D`1[T]"); - Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test7), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "D`1[T]"); - - - Console.WriteLine("\nType: A where T : struct(), new()\n"); - Console.WriteLine("\nNEGATIVE TESTS"); - - Check(new Case(SM_DefaultCtorAndStructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "E`1[T]"); - Check(new Case(SM_DefaultCtorAndStructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "E`1[T]"); - Check(new Case(SM_DefaultCtorAndStructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "E`1[T]"); - Check(new Case(SM_DefaultCtorAndStructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "E`1[T]"); - Check(new Case(SM_DefaultCtorAndStructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "E`1[T]"); - Check(new Case(SM_DefaultCtorAndStructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "E`1[T]"); - Check(new Case(SM_DefaultCtorAndStructConstraint.Test10), "Generic argument is an array of classes with default ctor", "NonGenStruct[]", "E`1[T]"); - Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "E`1[T]"); - Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "E`1[T]"); - Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "E`1[T]"); - Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test7), "Generic argument is Nullable", "System.Nullable`1[System.Int32]", "E`1[T]"); - - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_Constraints_Neg.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_Constraints_Neg.csproj deleted file mode 100644 index 448eb02af5..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_Constraints_Neg.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - StaticMethod_Constraints_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndClassConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndClassConstraint_Neg.il deleted file mode 100644 index d9240b906e..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndClassConstraint_Neg.il +++ /dev/null @@ -1,187 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticMethod_DefaultCtorAndClassConstraint_Neg {} - - -// Generic class with class() and new() constraints -.class public auto ansi beforefieldinit D`1 - extends [mscorlib]System.Object -{ - - .method public static hidebysig void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - - - -} - -.class public auto ansi beforefieldinit SM_DefaultCtorAndClassConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - call void class D`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - call void class D`1::method1() - ret - } - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - call void class D`1::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - call void class D`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - call void class D`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - call void class D`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - call void class D`1::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - call void class D`1::method1() - ret - } -} - -.class public auto ansi beforefieldinit SM_DefaultCtorAndClassConstraintGenTypes - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - call void class D`1>::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is a generic struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - call void class D`1>::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an generic interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - call void class D`1>::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - call void class D`1>::method1() - - ret - } - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - call void class D`1>::method1() - ret - } - -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndClassConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndClassConstraint_Neg.ilproj deleted file mode 100644 index d1fbfe1331..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndClassConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticMethod_DefaultCtorAndClassConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndStructConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndStructConstraint_Neg.il deleted file mode 100644 index a09efce3f5..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndStructConstraint_Neg.il +++ /dev/null @@ -1,162 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticMethod_DefaultCtorAndStructConstraint_Neg {} - - -// Generic class with struct() and new() constraints -.class public auto ansi beforefieldinit E`1 - extends [mscorlib]System.Object -{ - - .method public static hidebysig void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SM_DefaultCtorAndStructConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - call void class E`1::method1() - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - call void class E`1::method1() - ret - } - - // NEGATIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - call void class E`1::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - call void class E`1::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - call void class E`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - call void class E`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - call void class E`1::method1() - ret - } -} - -.class public auto ansi beforefieldinit SM_DefaultCtorAndStructConstraintGenTypes - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - call void class E`1>::method1() - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - call void class E`1>::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - call void class E`1>::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - call void class E`1>::method1() - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndStructConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndStructConstraint_Neg.ilproj deleted file mode 100644 index 75978bb441..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorAndStructConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticMethod_DefaultCtorAndStructConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorConstraint_Neg.il deleted file mode 100644 index c8adac64cd..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorConstraint_Neg.il +++ /dev/null @@ -1,123 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticMethod_DefaultCtorConstraint_Neg {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit A`1<.ctor T> - extends [mscorlib]System.Object -{ - - .method public static hidebysig void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit SM_DefaultCtorConstraint - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - call void class A`1::method1() - - ret - } - - // NEGATIVE TEST - // generic argument is a delegate (doesn't have public parameterless constructor) - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - call void class A`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - call void class A`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - call void class A`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - call void class A`1::method1() - - ret - } -} - -.class public auto ansi beforefieldinit SM_DefaultCtorConstraintGenTypes - extends [mscorlib]System.Object -{ - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - call void class A`1>::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - call void class A`1>::method1() - ret - } -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorConstraint_Neg.ilproj deleted file mode 100644 index 2ebd8251c4..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_DefaultCtorConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticMethod_DefaultCtorConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_StructConstraint_Neg.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_StructConstraint_Neg.il deleted file mode 100644 index 675639320d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_StructConstraint_Neg.il +++ /dev/null @@ -1,162 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticMethod_StructConstraint_Neg {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit C`1 - extends [mscorlib]System.Object -{ - - .method public static hidebysig void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SM_StructConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - call void class C`1::method1() - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - call void class C`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - call void class C`1::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - call void class C`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - call void class C`1::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - call void class C`1::method1() - ret - } - - // NEGATIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - call void class C`1::method1() - ret - } -} - -.class public auto ansi beforefieldinit SM_StructConstraintGenTypes - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - call void class C`1>::method1() - ret - } - - // NEGATIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - call void class C`1>::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is an interface - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - call void class C`1>::method1() - ret - } - - - // NEGATIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - call void class C`1>::method1() - - ret - } -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_StructConstraint_Neg.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_StructConstraint_Neg.ilproj deleted file mode 100644 index e578d8ed7e..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/StaticMethod_StructConstraint_Neg.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticMethod_StructConstraint_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam2_Constraints_Neg.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam2_Constraints_Neg.cs deleted file mode 100644 index abe962b409..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam2_Constraints_Neg.cs +++ /dev/null @@ -1,121 +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. - -/* Test various combinations of constraints with illegal parameter types by instantiating the type - -*/ - -using System; - - - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - - static void Check(Case mytest, string testName, string genArgNumber, string violatingType, string type, string typeParam) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException"); - pass = false; - } - catch (TypeLoadException e) - { - // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2' - // violates the constraint of type parameter '%3'. - - Test.CheckTypeLoadExceptionMessage(8310, genArgNumber, e, violatingType, type, typeParam); - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - public static void CheckTypeLoadExceptionMessage(uint ResourceID, string genArgNumber, TypeLoadException e, string violatingType, string type, string typeParam ) - { - if ( - !e.ToString().Contains(genArgNumber) || - !e.ToString().Contains(violatingType) || - !e.ToString().Contains(type) || - !e.ToString().Contains(typeParam)) - { - Console.WriteLine("Exception message is incorrect"); - pass = false; - } - else - { - Console.WriteLine("Caught expected exception"); - } - } - - public static int Main() - { - pass = true; - - Console.WriteLine("\nType: GClass where T : class\n"); - Console.WriteLine("NEGATIVE TESTS"); - - Check(new Case(RunTest.Test1), "class G1

: GClass

where P : struct {}, insantiate with class","0", "P", "GClass`1[T]", "T"); - Check(new Case(RunTest.Test2), "class G1

: GClass

where P : struct {}, instantiate with valuetype", "0", "P", "GClass`1[T]", "T"); - Check(new Case(RunTest.Test3), "class G2

: GClass

where P : I {}", "0", "P", "GClass`1[T]", "T"); - Check(new Case(RunTest.Test4), "class G3

: GClass

where P : System.Object {}", "0", "P", "GClass`1[T]", "T"); - Check(new Case(RunTest.Test5), "class G4

: GClass

where P : System.ValueType {}", "0", "P", "GClass`1[T]", "T"); - Check(new Case(RunTest.Test6), "class G5

: GClass

where P : System.Enum {}", "0", "P", "GClass`1[T]", "T"); - - - Console.WriteLine("\nType: GStruct where T : struct\n"); - Console.WriteLine("NEGATIVE TESTS"); - - - Check(new Case(RunTest.Test7), "class G6

: IStruct

where P : class {}, insantiate with class","0", "P", "GStruct`1[T]", "T"); - Check(new Case(RunTest.Test8), "class G6

: IStruct

where P : class {}, instantiate with valuetype", "0", "P", "GStruct`1[T]", "T"); - Check(new Case(RunTest.Test9), "class G7

: IStruct

where P : A {}", "0", "P", "GStruct`1[T]", "T"); - Check(new Case(RunTest.Test10), "class G8

: IStruct

where P : I {}", "0", "P", "GStruct`1[T]", "T"); - - Check(new Case(RunTest.Test14), "class G12

: IStruct

where P : System.ValueType {}", "0", "P", "GStruct`1[T]", "T"); - Check(new Case(RunTest.Test15), "class G12

: IStruct

where P : System.Nullable {}", "0", "P", "GStruct`1[T]", "T"); - - - Console.WriteLine("\nType: GNew where T : new() \n"); - Console.WriteLine("NEGATIVE TESTS"); - - - Check(new Case(RunTest.Test11), "class G9

: GNew

where P : A {}, insantiate with class","0", "P", "GNew`1[T]", "T"); - Check(new Case(RunTest.Test12), "class G10

: GNew

where P : class {}, instantiate with valuetype", "0", "P", "GNew`1[T]", "T"); - Check(new Case(RunTest.Test13), "class G11

: GNew

where P : I {}", "0", "P", "GNew`1[T]", "T"); - - - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam2_Constraints_Neg.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam2_Constraints_Neg.csproj deleted file mode 100644 index eb3a542679..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam2_Constraints_Neg.csproj +++ /dev/null @@ -1,43 +0,0 @@ - - - - - TypeParam2_Constraints_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam3_Constraints_Neg.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam3_Constraints_Neg.cs deleted file mode 100644 index 275785e70e..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam3_Constraints_Neg.cs +++ /dev/null @@ -1,123 +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. - -/* Test various combinations of constraints with illegal parameter types by instantiating the type - These tests are similar to TypeParam2* only here we have a generic interface I with a constraint on T - and in TypeParam2* we have a generic class G with a constraint on T. -*/ - -using System; - - - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - - static void Check(Case mytest, string testName, string genArgNumber, string violatingType, string type, string typeParam) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException"); - pass = false; - } - catch (TypeLoadException e) - { - // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2' - // violates the constraint of type parameter '%3'. - - Test.CheckTypeLoadExceptionMessage(8310, genArgNumber, e, violatingType, type, typeParam); - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - public static void CheckTypeLoadExceptionMessage(uint ResourceID, string genArgNumber, TypeLoadException e, string violatingType, string type, string typeParam ) - { - if ( - !e.ToString().Contains(genArgNumber) || - !e.ToString().Contains(violatingType) || - !e.ToString().Contains(type) || - !e.ToString().Contains(typeParam)) - { - Console.WriteLine("Exception message is incorrect"); - pass = false; - } - else - { - Console.WriteLine("Caught expected exception"); - } - } - - public static int Main() - { - pass = true; - - Console.WriteLine("\nType: IClass where T : class\n"); - Console.WriteLine("NEGATIVE TESTS"); - - Check(new Case(RunTest.Test1), "class G1

: IClass

where P : struct {}, insantiate with class","0", "P", "IClass`1[T]", "T"); - Check(new Case(RunTest.Test2), "class G1

: IClass

where P : struct {}, instantiate with valuetype", "0", "P", "IClass`1[T]", "T"); - Check(new Case(RunTest.Test3), "class G2

: IClass

where P : I {}", "0", "P", "IClass`1[T]", "T"); - Check(new Case(RunTest.Test4), "class G3

: IClass

where P : System.Object {}", "0", "P", "IClass`1[T]", "T"); - Check(new Case(RunTest.Test5), "class G4

: IClass

where P : System.ValueType {}", "0", "P", "IClass`1[T]", "T"); - Check(new Case(RunTest.Test6), "class G5

: IClass

where P : System.Enum {}", "0", "P", "IClass`1[T]", "T"); - - - Console.WriteLine("\nType: IStruct where T : struct\n"); - Console.WriteLine("NEGATIVE TESTS"); - - - Check(new Case(RunTest.Test7), "class G6

: IStruct

where P : class {}, insantiate with class","0", "P", "IStruct`1[T]", "T"); - Check(new Case(RunTest.Test8), "class G6

: IStruct

where P : class {}, instantiate with valuetype", "0", "P", "IStruct`1[T]", "T"); - Check(new Case(RunTest.Test9), "class G7

: IStruct

where P : A {}", "0", "P", "IStruct`1[T]", "T"); - Check(new Case(RunTest.Test10), "class G8

: IStruct

where P : I {}", "0", "P", "IStruct`1[T]", "T"); - - Check(new Case(RunTest.Test14), "class G12

: IStruct

where P : System.ValueType {}", "0", "P", "IStruct`1[T]", "T"); - Check(new Case(RunTest.Test15), "class G12

: IStruct

where P : System.Nullable {}", "0", "P", "IStruct`1[T]", "T"); - - - - Console.WriteLine("\nType: INew where T : new() \n"); - Console.WriteLine("NEGATIVE TESTS"); - - - Check(new Case(RunTest.Test11), "class G9

: INew

where P : A {}, insantiate with class","0", "P", "INew`1[T]", "T"); - Check(new Case(RunTest.Test12), "class G10

: INew

where P : class {}, instantiate with valuetype", "0", "P", "INew`1[T]", "T"); - Check(new Case(RunTest.Test13), "class G11

: INew

where P : I {}", "0", "P", "INew`1[T]", "T"); - - - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam3_Constraints_Neg.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam3_Constraints_Neg.csproj deleted file mode 100644 index 3eeb38e2a9..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/TypeParam3_Constraints_Neg.csproj +++ /dev/null @@ -1,43 +0,0 @@ - - - - - TypeParam3_Constraints_Neg - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/app.config b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/app.config deleted file mode 100644 index e5622f77ad..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/app.config +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/project.json b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/project.json deleted file mode 100644 index a2e84dc340..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/project.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1-rc2-23816", - "System.Collections": "4.0.10", - "System.Collections.NonGeneric": "4.0.1-rc2-23816", - "System.Collections.Specialized": "4.0.1-rc2-23816", - "System.ComponentModel": "4.0.1-rc2-23816", - "System.Console": "4.0.0-rc2-23816", - "System.Diagnostics.Process": "4.1.0-rc2-23816", - "System.Globalization": "4.0.10", - "System.Globalization.Calendars": "4.0.0", - "System.IO": "4.0.10", - "System.IO.FileSystem": "4.0.0", - "System.IO.FileSystem.Primitives": "4.0.0", - "System.Linq": "4.0.1-rc2-23816", - "System.Linq.Queryable": "4.0.1-rc2-23816", - "System.Reflection": "4.0.10", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.1.0-rc2-23816", - "System.Runtime.Extensions": "4.0.10", - "System.Runtime.Handles": "4.0.0", - "System.Runtime.InteropServices": "4.1.0-rc2-23816", - "System.Runtime.Loader": "4.0.0-rc2-23816", - "System.Text.Encoding": "4.0.10", - "System.Threading": "4.0.10", - "System.Threading.Thread": "4.0.0-rc2-23816", - "System.Xml.ReaderWriter": "4.0.11-rc2-23816", - "System.Xml.XDocument": "4.0.11-rc2-23816", - "System.Xml.XmlDocument": "4.0.1-rc2-23816", - "System.Xml.XmlSerializer": "4.0.11-rc2-23816" - }, - "frameworks": { - "dnxcore50": {} - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types.il deleted file mode 100644 index 53c0b9e255..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types.il +++ /dev/null @@ -1,117 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} - -.assembly Types {} - -// class with public nullary ctor -.class public auto ansi beforefieldinit ClassWithCtor - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// generic class with public nullary ctor -.class public auto ansi beforefieldinit GenClassWithCtor - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -// class without public nullary ctor -.class public auto ansi beforefieldinit ClassNoCtor - extends [mscorlib]System.Object -{ -} - -// generic class without public nullary ctor -.class public auto ansi beforefieldinit GenClassNoCtor - extends [mscorlib]System.Object -{ -} - - -// struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit NonGenStruct - extends [mscorlib]System.ValueType -{ - .pack 0 - .size 1 -} - - - -// generic struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit GenStruct - extends [mscorlib]System.ValueType -{ - .pack 0 - .size 1 -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit NonGenInterface -{ -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit GenInterface -{ -} - - -.class public auto ansi sealed Enum1 - extends [mscorlib]System.Enum -{ - .field public specialname rtspecialname int32 value__ - .field public static literal valuetype Enum1 One = int32(0x00000000) -} - - -// doesn't have public parameterless constructor -.class public auto ansi sealed Delegate1 - extends [mscorlib]System.MulticastDelegate -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor(object 'object', - native int 'method') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void Invoke() runtime managed - { - } - - .method public hidebysig newslot virtual - instance class [mscorlib]System.IAsyncResult - BeginInvoke(class [mscorlib]System.AsyncCallback callback, - object 'object') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed - { - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types.ilproj deleted file mode 100644 index e90ddd06ea..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - types - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI.il deleted file mode 100644 index 56a463547c..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI.il +++ /dev/null @@ -1,131 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} - -.assembly Types_implementI {} - - -.class interface public abstract auto ansi I {} - - -// class with public nullary ctor -.class public auto ansi beforefieldinit ClassWithCtor - extends [mscorlib]System.Object - implements I - -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// generic class with public nullary ctor -.class public auto ansi beforefieldinit GenClassWithCtor - extends [mscorlib]System.Object - implements I -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -// class without public nullary ctor -.class public auto ansi beforefieldinit ClassNoCtor - extends [mscorlib]System.Object - implements I -{ -} - -// generic class without public nullary ctor -.class public auto ansi beforefieldinit GenClassNoCtor - extends [mscorlib]System.Object - implements I -{ -} - - -// struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit NonGenStruct - extends [mscorlib]System.ValueType - implements I -{ - .pack 0 - .size 1 -} - - - -// generic struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit GenStruct - extends [mscorlib]System.ValueType - implements I -{ - .pack 0 - .size 1 -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit NonGenInterface - implements I -{ -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit GenInterface - implements I -{ -} - - -.class public auto ansi sealed Enum1 - extends [mscorlib]System.Enum -{ - .field public specialname rtspecialname int32 value__ - .field public static literal valuetype Enum1 One = int32(0x00000000) -} - - -// doesn't have public parameterless constructor -.class public auto ansi sealed Delegate1 - extends [mscorlib]System.MulticastDelegate - implements I -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor(object 'object', - native int 'method') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void Invoke() runtime managed - { - } - - .method public hidebysig newslot virtual - instance class [mscorlib]System.IAsyncResult - BeginInvoke(class [mscorlib]System.AsyncCallback callback, - object 'object') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed - { - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI.ilproj deleted file mode 100644 index 56d5b6ed3e..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - types_implementI - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI_extendC.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI_extendC.il deleted file mode 100644 index 68bcbe5c43..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI_extendC.il +++ /dev/null @@ -1,150 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} - -.assembly types_implementI_extendC {} - - -.class interface public abstract auto ansi I {} - -.class public auto ansi beforefieldinit C - extends [mscorlib]System.Object -{} - -// class with public nullary ctor implements I but doesn't extend C -.class public auto ansi beforefieldinit ClassWithCtor - extends [mscorlib]System.Object - implements I - -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// class with public nullary ctor extends C but doesn't implement I -.class public auto ansi beforefieldinit ClassWithCtor2 - extends C - -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -// generic class with public nullary ctor -.class public auto ansi beforefieldinit GenClassWithCtor - extends [mscorlib]System.Object - implements I -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -// class without public nullary ctor -.class public auto ansi beforefieldinit ClassNoCtor - extends [mscorlib]System.Object - implements I -{ -} - -// generic class without public nullary ctor -.class public auto ansi beforefieldinit GenClassNoCtor - extends [mscorlib]System.Object - implements I -{ -} - - -// struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit NonGenStruct - extends [mscorlib]System.ValueType - implements I -{ - .pack 0 - .size 1 -} - - - -// generic struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit GenStruct - extends [mscorlib]System.ValueType - implements I -{ - .pack 0 - .size 1 -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit NonGenInterface - implements I -{ -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit GenInterface - implements I -{ -} - - -.class public auto ansi sealed Enum1 - extends [mscorlib]System.Enum -{ - .field public specialname rtspecialname int32 value__ - .field public static literal valuetype Enum1 One = int32(0x00000000) -} - - -// doesn't have public parameterless constructor -.class public auto ansi sealed Delegate1 - extends [mscorlib]System.MulticastDelegate - implements I -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor(object 'object', - native int 'method') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void Invoke() runtime managed - { - } - - .method public hidebysig newslot virtual - instance class [mscorlib]System.IAsyncResult - BeginInvoke(class [mscorlib]System.AsyncCallback callback, - object 'object') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed - { - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI_extendC.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI_extendC.ilproj deleted file mode 100644 index 783be27964..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Negative/types_implementI_extendC.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - types_implementI_extendC - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_ClassConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_ClassConstraint_Pos.il deleted file mode 100644 index cb9ea447e3..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_ClassConstraint_Pos.il +++ /dev/null @@ -1,166 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Instantiation_ClassConstraint_Pos {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit B`1 - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit ClassConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class B`1::.ctor() - pop - - ret - } - - // POSITIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class B`1::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class B`1::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class B`1::.ctor() - pop - - ret - } - - - - // POSITIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - newobj instance void class B`1::.ctor() - pop - ret - } - - - // POSITIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - - newobj instance void class B`1::.ctor() - pop - - ret - } - - // POSITIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class B`1::.ctor() - pop - - ret - } - -} - -.class public auto ansi beforefieldinit ClassConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class B`1>::.ctor() - pop - - ret - } - - // POSITIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class B`1>::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class B`1>::.ctor() - pop - - ret - } -} - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_ClassConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_ClassConstraint_Pos.ilproj deleted file mode 100644 index 7be25616a1..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_ClassConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_ClassConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_Constraints_Pos.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_Constraints_Pos.cs deleted file mode 100644 index 58db02e46d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_Constraints_Pos.cs +++ /dev/null @@ -1,151 +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. - -/* Test various combinations of constraints with legal parameter types by instantiating the types - -CONSTRAINTS: - -default ctor -reference type -valuetype -default ctor, reference type -default ctor, valuetype - -Test each constraint with (whatever applies for positive testing) -- Class with default nullary ctor (Generic/Non generic) -- Class with no default nullary ctor (Generic/Non generic) -- Class from mscorlib with default nullary ctor -- Abstract Class from mscorlib with no default nullary ctor - -- Struct from mscorlib (Generic/Non generic) -- Struct (Generic/Non generic) -- Enum (Generic/Non generic) - -- Interface (Generic/Non generic) - -- Array - -- Delegate - -- Nullable - - - -*/ - -using System; - - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - static void Check(Case mytest, string testName) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - - Console.WriteLine(" : PASS"); - return; - } - catch (TypeLoadException e) - { - Console.WriteLine("\nFAIL: Caught unexpected TypeLoadException: " + e); - pass = false; - return; - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - public static int Main() - { - pass = true; - - Console.WriteLine("\nType: A where T : new()\n"); - - Console.WriteLine("POSITIVE TESTS"); - Check(new Case(DefaultCtorConstraint.Test1), "Generic argument is a class with default ctor"); - Check(new Case(DefaultCtorConstraint.Test3), "Generic argument is a struct (valuetypes have public nullary ctors by default)"); - Check(new Case(DefaultCtorConstraint.Test5), "Generic argument is an mscorlib class with default ctor"); - Check(new Case(DefaultCtorConstraint.Test8), "Generic argument is an enum"); - Check(new Case(DefaultCtorConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor"); - Check(new Case(DefaultCtorConstraintGenTypes.Test3), "Generic argument is a generic struct"); - Check(new Case(DefaultCtorConstraintGenTypes.Test6), "Generic argument is Nullable"); - - - Console.WriteLine("\nType: A where T : class()\n"); - - Console.WriteLine("POSITIVE TESTS"); - Check(new Case(ClassConstraint.Test1), "Generic argument is a class with default ctor"); - Check(new Case(ClassConstraint.Test2), "Generic argument is a class with no default ctor"); - Check(new Case(ClassConstraint.Test4), "Generic argument is a delegate"); - Check(new Case(ClassConstraint.Test5), "Generic argument is an mscorlib class with default ctor"); - Check(new Case(ClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor"); - Check(new Case(ClassConstraint.Test7), "Generic argument is an interface"); - Check(new Case(ClassConstraint.Test9), "Generic argument is an array of classes with default ctor"); - Check(new Case(ClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor"); - Check(new Case(ClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor"); - Check(new Case(ClassConstraintGenTypes.Test5), "Generic argument is a generic interface"); - - - Console.WriteLine("\nType: A where T : struct()\n"); - - Console.WriteLine("POSITIVE TESTS"); - Check(new Case(StructConstraint.Test3), "Generic argument is a struct"); - Check(new Case(StructConstraint.Test8), "Generic argument is an enum"); - Check(new Case(StructConstraint.Test9), "Generic argument is an mscorlib struct"); - Check(new Case(StructConstraintGenTypes.Test3), "Generic argument is a generic struct"); - Check(new Case(StructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct"); - - - - Console.WriteLine("\nType: A where T : class(), new() \n"); - - Console.WriteLine("POSITIVE TESTS"); - Check(new Case(DefaultCtorAndClassConstraint.Test1), "Generic argument is a class with default ctor"); - Check(new Case(DefaultCtorAndClassConstraint.Test5), "Generic argument is a is an mscorlib class with default ctor"); - Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor"); - - - Console.WriteLine("\nType: A where T : struct(), new()\n"); - - Console.WriteLine("POSITIVE TESTS"); - Check(new Case(DefaultCtorAndStructConstraint.Test3), "Generic argument is a struct"); - Check(new Case(DefaultCtorAndStructConstraint.Test9), "Generic argument is an mscorlib struct"); - Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test3), "Generic argument is a generic struct"); - Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct"); - Check(new Case(DefaultCtorAndStructConstraint.Test8), "Generic argument is an enum"); - - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_Constraints_Pos.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_Constraints_Pos.csproj deleted file mode 100644 index f11d4b5a2c..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_Constraints_Pos.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Instantiation_Constraints_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassConstraint_Pos.il deleted file mode 100644 index e24a554821..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassConstraint_Pos.il +++ /dev/null @@ -1,80 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Instantiation_DefaultCtorAndClassConstraint_Pos {} - - -// Generic class with class() and new() constraints -.class public auto ansi beforefieldinit D`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - - - -} - -.class public auto ansi beforefieldinit DefaultCtorAndClassConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - -} - -.class public auto ansi beforefieldinit DefaultCtorAndClassConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassConstraint_Pos.ilproj deleted file mode 100644 index f6c7873c97..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_DefaultCtorAndClassConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassTypeConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassTypeConstraint_Pos.il deleted file mode 100644 index e92f92b8a0..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassTypeConstraint_Pos.il +++ /dev/null @@ -1,77 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types_implementI_extendC{} - -.assembly Instantiation_DefaultCtorAndClassTypeConstraint_Pos {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit F`1<.ctor ([types_implementI_extendC]C) T> - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit Instantiation_DefaultCtorAndClassTypeConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor that implements I and extends C - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - - - - // POSITIVE TEST - // generic argument is a generic class with default ctor that implements I and extends C - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is a class with default ctor that doesn't implements I but extends C - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassTypeConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassTypeConstraint_Pos.ilproj deleted file mode 100644 index e6c72e025a..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndClassTypeConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_DefaultCtorAndClassTypeConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndStructConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndStructConstraint_Pos.il deleted file mode 100644 index 977aec5d90..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndStructConstraint_Pos.il +++ /dev/null @@ -1,104 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Instantiation_DefaultCtorAndStructConstraint_Pos {} - - -// Generic class with struct() and new() constraints -.class public auto ansi beforefieldinit E`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit DefaultCtorAndStructConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - -} - -.class public auto ansi beforefieldinit DefaultCtorAndStructConstraintGenTypes - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndStructConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndStructConstraint_Pos.ilproj deleted file mode 100644 index ffe14ae58d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorAndStructConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_DefaultCtorAndStructConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorConstraint_Pos.il deleted file mode 100644 index 307938528d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorConstraint_Pos.il +++ /dev/null @@ -1,144 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Instantiation_DefaultCtorConstraint_Pos {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit A`1<.ctor T> - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit DefaultCtorConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is a struct (valuetypes have public nullary ctors by default) - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an enum with no default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - - // generic argument is NUllable - .method public hidebysig static void Test10() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - -} - -.class public auto ansi beforefieldinit DefaultCtorConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class A`1>::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class A`1>::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class A`1>::.ctor() - pop - - ret - } - - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorConstraint_Pos.ilproj deleted file mode 100644 index 281b435fef..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_DefaultCtorConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_DefaultCtorConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_StructConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_StructConstraint_Pos.il deleted file mode 100644 index bf7a82c3a1..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_StructConstraint_Pos.il +++ /dev/null @@ -1,104 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly Instantiation_StructConstraint_Pos {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit C`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit StructConstraint - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class C`1::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - newobj instance void class C`1::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - newobj instance void class C`1::.ctor() - pop - - ret - } - -} - -.class public auto ansi beforefieldinit StructConstraintGenTypes - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class C`1>::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - newobj instance void class C`1>::.ctor() - pop - - ret - } -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_StructConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_StructConstraint_Pos.ilproj deleted file mode 100644 index 6508369179..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Instantiation_StructConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Instantiation_StructConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassConstraint_Pos.il deleted file mode 100644 index 0214f0ac72..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassConstraint_Pos.il +++ /dev/null @@ -1,68 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types_implementI{} - -.assembly Interface_DefaultCtorAndClassConstraint_Pos {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit D`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit Interface_DefaultCtorAndClassConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class D`1::.ctor() - pop - - ret - } - - - - - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class D`1>::.ctor() - pop - - ret - } - - - - - - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassConstraint_Pos.ilproj deleted file mode 100644 index f6541b415d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Interface_DefaultCtorAndClassConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassTypeConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassTypeConstraint_Pos.il deleted file mode 100644 index 73b4341d1d..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassTypeConstraint_Pos.il +++ /dev/null @@ -1,68 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types_implementI_extendC{} - -.assembly Interface_DefaultCtorAndClassTypeConstraint_Pos {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit F`1<.ctor ([types_implementI_extendC]C, [types_implementI_extendC]I) T> - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit Interface_DefaultCtorAndClassTypeConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor that implements I and extends C - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class F`1::.ctor() - pop - - ret - } - - - - - // POSITIVE TEST - // generic argument is a generic class with default ctor that implements I and extends C - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class F`1>::.ctor() - pop - - ret - } - - - - - - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassTypeConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassTypeConstraint_Pos.ilproj deleted file mode 100644 index 3aa0fd70af..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndClassTypeConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Interface_DefaultCtorAndClassTypeConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndStructConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndStructConstraint_Pos.il deleted file mode 100644 index e3d332530f..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndStructConstraint_Pos.il +++ /dev/null @@ -1,66 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types_implementI{} - -.assembly Interface_DefaultCtorAndStructConstraint_Pos {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit E`1 - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit Interface_DefaultCtorAndStructConstraint - extends [mscorlib]System.Object -{ - // NEGATIVE TEST - // generic argument is a struct (valuetypes have public nullary ctors by default) - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class E`1::.ctor() - pop - - ret - } - - - // NEGATIVE TEST - // generic argument is a struct - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class E`1>::.ctor() - pop - - ret - } - - - - - - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndStructConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndStructConstraint_Pos.ilproj deleted file mode 100644 index d3bebb3289..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorAndStructConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Interface_DefaultCtorAndStructConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorConstraint_Pos.il deleted file mode 100644 index f6b7d148fe..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorConstraint_Pos.il +++ /dev/null @@ -1,86 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types_implementI{} - -.assembly Interface_DefaultCtorConstraint_Pos {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit A`1<.ctor ([types_implementI]I) T> - extends [mscorlib]System.Object -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit Interface_DefaultCtorConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - - - // POSITIVE TEST - // generic argument is a struct (valuetypes have public nullary ctors by default) - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - newobj instance void class A`1::.ctor() - pop - - ret - } - - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - newobj instance void class A`1>::.ctor() - pop - - ret - } - - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - newobj instance void class A`1>::.ctor() - pop - - ret - } - -} - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorConstraint_Pos.ilproj deleted file mode 100644 index 4722c83401..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/Interface_DefaultCtorConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Interface_DefaultCtorConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos.il deleted file mode 100644 index 58f9377162..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos.il +++ /dev/null @@ -1,52 +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. - -.assembly extern System.Console { } -// this file contains positive tests for -// G where T : U where U : struct -// C# didn't want to compile such type definition so we are using IL. - - -.assembly extern mscorlib {} -.assembly extern TypeParam_Constraints_Pos {} -.assembly RunTestPos {} - - -.class public auto ansi beforefieldinit GStruct`2<(!U) T, valuetype U> - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - - -.class public auto ansi beforefieldinit RunGStructTest - extends [mscorlib]System.Object -{ - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - newobj instance void class GStruct`2::.ctor() - pop - ret - } - - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - newobj instance void class GStruct`2::.ctor() - pop - ret - } -} - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos.ilproj deleted file mode 100644 index 09852112b4..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos.ilproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - RunTestPos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos2.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos2.il deleted file mode 100644 index d0ff480f36..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos2.il +++ /dev/null @@ -1,57 +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. - -.assembly extern System.Console { } -// this file contains positive test for -// GStruct where T : struct -// G4

: GStruct

where P : valuetype S - -// C# didn't want to compile such type definition so we are using IL. - - -.assembly extern mscorlib {} -.assembly extern TypeParam2_Constraints_Pos {} -.assembly RunTestPos2 {} - -.class public auto ansi beforefieldinit GStruct`1 - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit G4`1<(valuetype [TypeParam2_Constraints_Pos]S) P> - extends class GStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - - -.class public sequential ansi sealed beforefieldinit S_PrivCtor - extends [mscorlib]System.ValueType -{ - .pack 0 - .size 1 -} - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos2.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos2.ilproj deleted file mode 100644 index 54739ed81b..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos2.ilproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - RunTestPos2 - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos3.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos3.il deleted file mode 100644 index 45afb6d897..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos3.il +++ /dev/null @@ -1,57 +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. - -.assembly extern System.Console { } -// this file contains positive test for -// interface IStruct where T : struct -// G4

: IStruct

where P : valuetype S - -// C# didn't want to compile such type definition so we are using IL. - - -.assembly extern mscorlib {} -.assembly extern TypeParam3_Constraints_Pos {} -.assembly RunTestPos3 {} - -.class interface public abstract auto ansi IStruct`1 {} - - -.class public auto ansi beforefieldinit G4`1<(valuetype [TypeParam3_Constraints_Pos]S) P> - implements class IStruct`1 -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - - -.class public sequential ansi sealed beforefieldinit S_PrivCtor - extends [mscorlib]System.ValueType -{ - .pack 0 - .size 1 - - .method private hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos3.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos3.ilproj deleted file mode 100644 index 41469c2098..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/RunTestPos3.ilproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - RunTestPos3 - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_ClassConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_ClassConstraint_Pos.il deleted file mode 100644 index 8e39680aed..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_ClassConstraint_Pos.il +++ /dev/null @@ -1,173 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticField_ClassConstraint_Pos {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit B`1 - extends [mscorlib]System.Object -{ - - .field public static int32 i - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SF_ClassConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1::i - pop - - ret - } - - // POSITIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1::i - pop - - ret - } - - - - // POSITIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - ldsfld int32 class B`1::i - pop - ret - } - - - // POSITIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - ldsfld int32 class B`1::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1::i - pop - - ret - } - - - -} - -.class public auto ansi beforefieldinit SF_ClassConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1>::i - pop - - ret - } - - // POSITIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1>::i - pop - - ret - } - - - - // POSITIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - ldsfld int32 class B`1>::i - pop - - ret - } - -} - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_ClassConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_ClassConstraint_Pos.ilproj deleted file mode 100644 index 864e7cbd71..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_ClassConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticField_ClassConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_Constraints_Pos.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_Constraints_Pos.cs deleted file mode 100644 index 70715d8e44..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_Constraints_Pos.cs +++ /dev/null @@ -1,157 +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. - -/* Test various combinations of constraints with legal parameter types accessing static field of the generic type - -CONSTRAINTS: - -default ctor -reference type -valuetype -default ctor, reference tyoe -default ctor, valuetype - -Test each constraint with (whichever apply for positive tests) -- Class with default nullary ctor (Generic/Non generic) -- Class with no default nullary ctor (Generic/Non generic) -- Class from mscorlib with default nullary ctor -- Abstract Class from mscorlib with no default nullary ctor - -- Struct from mscorlib (Generic/Non generic) -- Struct (Generic/Non generic) -- Enum (Generic/Non generic) - -- Interface (Generic/Non generic) - -- Array - -- Delegate - -- Nullable - -*/ - -using System; - - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - - static void Check(Case mytest, string testName) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - - Console.WriteLine(" : PASS"); - return; - } - catch (TypeLoadException e) - { - Console.WriteLine("\nFAIL: Caught unexpected TypeLoadException: " + e); - pass = false; - return; - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - - public static int Main() - { - pass = true; - - Console.WriteLine("\nType: A where T : new()\n"); - Console.WriteLine("POSITIVE TESTS"); - - Check(new Case(SF_DefaultCtorConstraint.Test1), "Generic argument is a class with default ctor"); - Check(new Case(SF_DefaultCtorConstraint.Test3), "Generic argument is a struct (valuetypes have public nullary ctors by default)"); - Check(new Case(SF_DefaultCtorConstraint.Test5), "Generic argument is an mscorlib class with default ctor"); - // enum is a valueypte and all valuetypes have public nullary ctors. - Check(new Case(SF_DefaultCtorConstraint.Test8), "Generic argument is an enum"); - Check(new Case(SF_DefaultCtorConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor"); - Check(new Case(SF_DefaultCtorConstraintGenTypes.Test3), "Generic argument is a generic struct"); - Check(new Case(SF_DefaultCtorConstraintGenTypes.Test6), "Generic argument is Nullable"); - - - Console.WriteLine("\nType: A where T : class()\n"); - Console.WriteLine("POSITIVE TESTS"); - - Check(new Case(SF_ClassConstraint.Test1), "Generic argument is a class with default ctor"); - Check(new Case(SF_ClassConstraint.Test2), "Generic argument is a class with no default ctor"); - Check(new Case(SF_ClassConstraint.Test4), "Generic argument is a delegate"); - Check(new Case(SF_ClassConstraint.Test5), "Generic argument is an mscorlib class with default ctor"); - Check(new Case(SF_ClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor"); - Check(new Case(SF_ClassConstraint.Test7), "Generic argument is an interface"); - Check(new Case(SF_ClassConstraint.Test9), "Generic argument is an array of classes with default ctor"); - Check(new Case(SF_ClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor"); - Check(new Case(SF_ClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor"); - Check(new Case(SF_ClassConstraintGenTypes.Test5), "Generic argument is a generic interface"); - - - - Console.WriteLine("\nType: A where T : struct()\n"); - Console.WriteLine("POSITIVE TESTS"); - - Check(new Case(SF_StructConstraint.Test3), "Generic argument is a struct"); - Check(new Case(SF_StructConstraint.Test8), "Generic argument is an enum"); - Check(new Case(SF_StructConstraint.Test9), "Generic argument is an mscorlib struct"); - Check(new Case(SF_StructConstraintGenTypes.Test3), "Generic argument is a generic struct"); - Check(new Case(SF_StructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct"); - - - - Console.WriteLine("\nType: A where T : class(), new() \n"); - Console.WriteLine("POSITIVE TESTS"); - - Check(new Case(SF_DefaultCtorAndClassConstraint.Test1), "Generic argument is a class with default ctor"); - Check(new Case(SF_DefaultCtorAndClassConstraint.Test5), "Generic argument is a is an mscorlib class with default ctor"); - Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor"); - - - - Console.WriteLine("\nType: A where T : struct(), new()\n"); - Console.WriteLine("POSITIVE TESTS"); - - - Check(new Case(SF_DefaultCtorAndStructConstraint.Test3), "Generic argument is a struct"); - Check(new Case(SF_DefaultCtorAndStructConstraint.Test9), "Generic argument is an mscorlib struct"); - Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test3), "Generic argument is a generic struct"); - Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct"); - Check(new Case(SF_DefaultCtorAndStructConstraint.Test8), "Generic argument is an enum"); - - - - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_Constraints_Pos.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_Constraints_Pos.csproj deleted file mode 100644 index f46552f33e..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_Constraints_Pos.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - StaticField_Constraints_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndClassConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndClassConstraint_Pos.il deleted file mode 100644 index 078ac97f8c..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndClassConstraint_Pos.il +++ /dev/null @@ -1,83 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticField_DefaultCtorAndClassConstraint_Pos {} - - -// Generic class with class() and new() constraints -.class public auto ansi beforefieldinit D`1 - extends [mscorlib]System.Object -{ - - .field public static int32 i - - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - - - -} - -.class public auto ansi beforefieldinit SF_DefaultCtorAndClassConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1::i - pop - - ret - } - - -} - -.class public auto ansi beforefieldinit SF_DefaultCtorAndClassConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - ldsfld int32 class D`1>::i - pop - - ret - } -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndClassConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndClassConstraint_Pos.ilproj deleted file mode 100644 index 13b68b394b..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndClassConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticField_DefaultCtorAndClassConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndStructConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndStructConstraint_Pos.il deleted file mode 100644 index 6a649cb0b4..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndStructConstraint_Pos.il +++ /dev/null @@ -1,112 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticField_DefaultCtorAndStructConstraint_Pos {} - - -// Generic class with struct() and new() constraints -.class public auto ansi beforefieldinit E`1 - extends [mscorlib]System.Object -{ - - .field public static int32 i - - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SF_DefaultCtorAndStructConstraint - extends [mscorlib]System.Object -{ - - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1::i - pop - - ret - } - -} - -.class public auto ansi beforefieldinit SF_DefaultCtorAndStructConstraintGenTypes - extends [mscorlib]System.Object -{ - - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1>::i - pop - - ret - } - - - - // POSITIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - ldsfld int32 class E`1>::i - pop - - ret - } - - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndStructConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndStructConstraint_Pos.ilproj deleted file mode 100644 index 435347ac94..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorAndStructConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticField_DefaultCtorAndStructConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorConstraint_Pos.il deleted file mode 100644 index 8c76992797..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorConstraint_Pos.il +++ /dev/null @@ -1,133 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticField_DefaultCtorConstraint_Pos {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit A`1<.ctor T> - extends [mscorlib]System.Object -{ - - .field public static int32 i - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit SF_DefaultCtorConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is a struct (valuetypes have public nullary ctors by default) - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1::i - pop - - ret - } - - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an enum with no default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1::i - pop - - ret - } - -} - -.class public auto ansi beforefieldinit SF_DefaultCtorConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1>::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1>::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - ldsfld int32 class A`1>::i - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorConstraint_Pos.ilproj deleted file mode 100644 index 8d4711e466..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_DefaultCtorConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticField_DefaultCtorConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_StructConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_StructConstraint_Pos.il deleted file mode 100644 index b1ab85a5f5..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_StructConstraint_Pos.il +++ /dev/null @@ -1,108 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticField_StructConstraint_Pos {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit C`1 - extends [mscorlib]System.Object -{ - .field public static int32 i - - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SF_StructConstraint - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1::i - pop - - ret - } - -} - -.class public auto ansi beforefieldinit SF_StructConstraintGenTypes - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1>::i - pop - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - ldsfld int32 class C`1>::i - - pop - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_StructConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_StructConstraint_Pos.ilproj deleted file mode 100644 index 5d9d2fad9a..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticField_StructConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticField_StructConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_ClassConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_ClassConstraint_Pos.il deleted file mode 100644 index 381742b589..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_ClassConstraint_Pos.il +++ /dev/null @@ -1,154 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticMethod_ClassConstraint_Pos {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit B`1 - extends [mscorlib]System.Object -{ - - .method public static hidebysig void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SM_ClassConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - call void class B`1::method1() - ret - } - - // POSITIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - call void class B`1::method1() - ret - } - - - // POSITIVE TEST - // generic argument is a delegate - .method public hidebysig static void Test4() cil managed - { - .maxstack 1 - - call void class B`1::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - call void class B`1::method1() - ret - } - - - - // POSITIVE TEST - // generic argument is an mscorlib abstract class with no default ctor - - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - - call void class B`1::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an interface - .method public hidebysig static void Test7() cil managed - { - .maxstack 1 - call void class B`1::method1() - ret - } - - // POSITIVE TEST - // generic argument is an array of classes with default ctor - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - call void class B`1::method1() - ret - } - - - -} - -.class public auto ansi beforefieldinit SM_ClassConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - call void class B`1>::method1() - ret - } - - // POSITIVE TEST - // generic argument is a class with no default ctor - .method public hidebysig static void Test2() cil managed - { - .maxstack 1 - - call void class B`1>::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an interface with no default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - call void class B`1>::method1() - ret - } - -} - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_ClassConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_ClassConstraint_Pos.ilproj deleted file mode 100644 index 53f0e0c729..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_ClassConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticMethod_ClassConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_Constraints_Pos.cs b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_Constraints_Pos.cs deleted file mode 100644 index 869759b590..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_Constraints_Pos.cs +++ /dev/null @@ -1,152 +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. - -/* Test various combinations of constraints with legal parameter types by invoking static method on the generic type -CONSTRAINTS: - -default ctor -reference type -valuetype -default ctor, reference tyoe -default ctor, valuetype - -Test each constraint with (whichever apply to positive tests) -- Class with default nullary ctor (Generic/Non generic) -- Class with no default nullary ctor (Generic/Non generic) -- Class from mscorlib with default nullary ctor -- Abstract Class from mscorlib with no default nullary ctor - -- Struct from mscorlib (Generic/Non generic) -- Struct (Generic/Non generic) -- Enum (Generic/Non generic) - -- Interface (Generic/Non generic) - -- Array - -- Delegate - -- Nullable -*/ - -using System; - - -public class Test -{ - static bool pass; - static int testNumber = 1; - - delegate void Case(); - - - - static void Check(Case mytest, string testName) - { - - Console.Write("Test"+testNumber + ": " + testName); - ++testNumber; - - - try - { - mytest(); - - - Console.WriteLine(" : PASS"); - return; - } - catch (TypeLoadException e) - { - Console.WriteLine("\nFAIL: Caught unexpected TypeLoadException: " + e); - pass = false; - return; - } - - catch (Exception e) - { - Console.WriteLine("\nFAIL: Caught unexpected exception: " + e); - pass = false; - } - - } - - - - public static int Main() - { - pass = true; - - Console.WriteLine("\nType: A where T : new()\n"); - Console.WriteLine("POSITIVE TESTS"); - - Check(new Case(SM_DefaultCtorConstraint.Test1), "Generic argument is a class with default ctor" ); - Check(new Case(SM_DefaultCtorConstraint.Test3), "Generic argument is a struct (valuetypes have public nullary ctors by default)"); - Check(new Case(SM_DefaultCtorConstraint.Test5), "Generic argument is an mscorlib class with default ctor"); - // enum is a valueypte and all valuetypes have public nullary ctors. - Check(new Case(SM_DefaultCtorConstraint.Test8), "Generic argument is an enum"); - Check(new Case(SM_DefaultCtorConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor"); - Check(new Case(SM_DefaultCtorConstraintGenTypes.Test3), "Generic argument is a generic struct"); - Check(new Case(SM_DefaultCtorConstraintGenTypes.Test6), "Generic argument is Nullable"); - - - Console.WriteLine("\nType: A where T : class()\n"); - Console.WriteLine("POSITIVE TESTS"); - - Check(new Case(SM_ClassConstraint.Test1), "Generic argument is a class with default ctor"); - Check(new Case(SM_ClassConstraint.Test2), "Generic argument is a class with no default ctor"); - Check(new Case(SM_ClassConstraint.Test4), "Generic argument is a delegate"); - Check(new Case(SM_ClassConstraint.Test5), "Generic argument is an mscorlib class with default ctor"); - Check(new Case(SM_ClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor"); - Check(new Case(SM_ClassConstraint.Test7), "Generic argument is an interface"); - Check(new Case(SM_ClassConstraint.Test9), "Generic argument is an array of classes with default ctor"); - Check(new Case(SM_ClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor"); - Check(new Case(SM_ClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor"); - Check(new Case(SM_ClassConstraintGenTypes.Test5), "Generic argument is a generic interface"); - - - Console.WriteLine("\nType: A where T : struct()\n"); - Console.WriteLine("POSITIVE TESTS"); - - Check(new Case(SM_StructConstraint.Test3), "Generic argument is a struct"); - Check(new Case(SM_StructConstraint.Test8), "Generic argument is an enum"); - Check(new Case(SM_StructConstraint.Test9), "Generic argument is an mscorlib struct"); - Check(new Case(SM_StructConstraintGenTypes.Test3), "Generic argument is a generic struct"); - Check(new Case(SM_StructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct"); - - - - Console.WriteLine("\nType: A where T : class(), new() \n"); - Console.WriteLine("POSITIVE TESTS"); - - Check(new Case(SM_DefaultCtorAndClassConstraint.Test1), "Generic argument is a class with default ctor"); - Check(new Case(SM_DefaultCtorAndClassConstraint.Test5), "Generic argument is a is an mscorlib class with default ctor"); - Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor"); - - - - Console.WriteLine("\nType: A where T : struct(), new()\n"); - Console.WriteLine("POSITIVE TESTS"); - - Check(new Case(SM_DefaultCtorAndStructConstraint.Test3), "Generic argument is a struct"); - Check(new Case(SM_DefaultCtorAndStructConstraint.Test9), "Generic argument is an mscorlib struct"); - Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test3), "Generic argument is a generic struct"); - Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct"); - Check(new Case(SM_DefaultCtorAndStructConstraint.Test8), "Generic argument is an enum"); - - - if (pass) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - - } -} - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_Constraints_Pos.csproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_Constraints_Pos.csproj deleted file mode 100644 index fa0690db03..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_Constraints_Pos.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - StaticMethod_Constraints_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - false - Exe - BuildAndRun - 0 - - - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndClassConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndClassConstraint_Pos.il deleted file mode 100644 index 11458e132e..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndClassConstraint_Pos.il +++ /dev/null @@ -1,79 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticMethod_DefaultCtorAndClassConstraint_Pos {} - - -// Generic class with class() and new() constraints -.class public auto ansi beforefieldinit D`1 - extends [mscorlib]System.Object -{ - - .method public static hidebysig void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - - - -} - -.class public auto ansi beforefieldinit SM_DefaultCtorAndClassConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - call void class D`1::method1() - ret - } - - - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - - call void class D`1::method1() - ret - } - -} - -.class public auto ansi beforefieldinit SM_DefaultCtorAndClassConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - call void class D`1>::method1() - ret - } - -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndClassConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndClassConstraint_Pos.ilproj deleted file mode 100644 index 91d0d6d1c9..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndClassConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticMethod_DefaultCtorAndClassConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndStructConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndStructConstraint_Pos.il deleted file mode 100644 index 461387c9c9..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndStructConstraint_Pos.il +++ /dev/null @@ -1,102 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticMethod_DefaultCtorAndStructConstraint_Pos {} - - -// Generic class with struct() and new() constraints -.class public auto ansi beforefieldinit E`1 - extends [mscorlib]System.Object -{ - - .method public static hidebysig void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SM_DefaultCtorAndStructConstraint - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - call void class E`1::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - call void class E`1::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - call void class E`1::method1() - ret - } - -} - -.class public auto ansi beforefieldinit SM_DefaultCtorAndStructConstraintGenTypes - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - call void class E`1>::method1() - ret - } - - // POSITIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - call void class E`1>::method1() - - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndStructConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndStructConstraint_Pos.ilproj deleted file mode 100644 index 1f17e790fc..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorAndStructConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticMethod_DefaultCtorAndStructConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorConstraint_Pos.il deleted file mode 100644 index 4ebbba6d47..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorConstraint_Pos.il +++ /dev/null @@ -1,124 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticMethod_DefaultCtorConstraint_Pos {} - - -// Generic class with new() constraint -.class public auto ansi beforefieldinit A`1<.ctor T> - extends [mscorlib]System.Object -{ - - .method public static hidebysig void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } - -} - -.class public auto ansi beforefieldinit SM_DefaultCtorConstraint - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - call void class A`1::method1() - - ret - } - - - // POSITIVE TEST - // generic argument is a struct (valuetypes have public nullary ctors by default) - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - call void class A`1::method1() - - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib class with default ctor - .method public hidebysig static void Test5() cil managed - { - .maxstack 1 - call void class A`1::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an enum with no default ctor - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - call void class A`1::method1() - ret - } - -} - -.class public auto ansi beforefieldinit SM_DefaultCtorConstraintGenTypes - extends [mscorlib]System.Object -{ - // POSITIVE TEST - // generic argument is a class with default ctor - .method public hidebysig static void Test1() cil managed - { - .maxstack 1 - - call void class A`1>::method1() - ret - } - - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - call void class A`1>::method1() - ret - } - - - // POSITIVE TEST - // generic argument is NUllable - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - call void class A`1>::method1() - ret - } - -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorConstraint_Pos.ilproj deleted file mode 100644 index 8d62ad1d96..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_DefaultCtorConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticMethod_DefaultCtorConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_StructConstraint_Pos.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_StructConstraint_Pos.il deleted file mode 100644 index ff434d1ef9..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_StructConstraint_Pos.il +++ /dev/null @@ -1,101 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} -.assembly extern types{} - -.assembly StaticMethod_StructConstraint_Pos {} - - -// Generic class with class() constraint -.class public auto ansi beforefieldinit C`1 - extends [mscorlib]System.Object -{ - - .method public static hidebysig void - method1() cil managed - { - .maxstack 8 - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -.class public auto ansi beforefieldinit SM_StructConstraint - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - call void class C`1::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an enum - .method public hidebysig static void Test8() cil managed - { - .maxstack 1 - - call void class C`1::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib struct - .method public hidebysig static void Test9() cil managed - { - .maxstack 1 - - call void class C`1::method1() - ret - } -} - -.class public auto ansi beforefieldinit SM_StructConstraintGenTypes - extends [mscorlib]System.Object -{ - - // POSITIVE TEST - // generic argument is a struct - .method public hidebysig static void Test3() cil managed - { - .maxstack 1 - - call void class C`1>::method1() - ret - } - - - // POSITIVE TEST - // generic argument is an mscorlib generic struct - .method public hidebysig static void Test6() cil managed - { - .maxstack 1 - - call void class C`1>::method1() - - ret - } -} - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_StructConstraint_Pos.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_StructConstraint_Pos.ilproj deleted file mode 100644 index 4698beeb5e..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/StaticMethod_StructConstraint_Pos.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - StaticMethod_StructConstraint_Pos - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/app.config b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/app.config deleted file mode 100644 index e5622f77ad..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/app.config +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/project.json b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/project.json deleted file mode 100644 index a2e84dc340..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/project.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1-rc2-23816", - "System.Collections": "4.0.10", - "System.Collections.NonGeneric": "4.0.1-rc2-23816", - "System.Collections.Specialized": "4.0.1-rc2-23816", - "System.ComponentModel": "4.0.1-rc2-23816", - "System.Console": "4.0.0-rc2-23816", - "System.Diagnostics.Process": "4.1.0-rc2-23816", - "System.Globalization": "4.0.10", - "System.Globalization.Calendars": "4.0.0", - "System.IO": "4.0.10", - "System.IO.FileSystem": "4.0.0", - "System.IO.FileSystem.Primitives": "4.0.0", - "System.Linq": "4.0.1-rc2-23816", - "System.Linq.Queryable": "4.0.1-rc2-23816", - "System.Reflection": "4.0.10", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.1.0-rc2-23816", - "System.Runtime.Extensions": "4.0.10", - "System.Runtime.Handles": "4.0.0", - "System.Runtime.InteropServices": "4.1.0-rc2-23816", - "System.Runtime.Loader": "4.0.0-rc2-23816", - "System.Text.Encoding": "4.0.10", - "System.Threading": "4.0.10", - "System.Threading.Thread": "4.0.0-rc2-23816", - "System.Xml.ReaderWriter": "4.0.11-rc2-23816", - "System.Xml.XDocument": "4.0.11-rc2-23816", - "System.Xml.XmlDocument": "4.0.1-rc2-23816", - "System.Xml.XmlSerializer": "4.0.11-rc2-23816" - }, - "frameworks": { - "dnxcore50": {} - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types.il deleted file mode 100644 index 53c0b9e255..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types.il +++ /dev/null @@ -1,117 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} - -.assembly Types {} - -// class with public nullary ctor -.class public auto ansi beforefieldinit ClassWithCtor - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// generic class with public nullary ctor -.class public auto ansi beforefieldinit GenClassWithCtor - extends [mscorlib]System.Object -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -// class without public nullary ctor -.class public auto ansi beforefieldinit ClassNoCtor - extends [mscorlib]System.Object -{ -} - -// generic class without public nullary ctor -.class public auto ansi beforefieldinit GenClassNoCtor - extends [mscorlib]System.Object -{ -} - - -// struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit NonGenStruct - extends [mscorlib]System.ValueType -{ - .pack 0 - .size 1 -} - - - -// generic struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit GenStruct - extends [mscorlib]System.ValueType -{ - .pack 0 - .size 1 -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit NonGenInterface -{ -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit GenInterface -{ -} - - -.class public auto ansi sealed Enum1 - extends [mscorlib]System.Enum -{ - .field public specialname rtspecialname int32 value__ - .field public static literal valuetype Enum1 One = int32(0x00000000) -} - - -// doesn't have public parameterless constructor -.class public auto ansi sealed Delegate1 - extends [mscorlib]System.MulticastDelegate -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor(object 'object', - native int 'method') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void Invoke() runtime managed - { - } - - .method public hidebysig newslot virtual - instance class [mscorlib]System.IAsyncResult - BeginInvoke(class [mscorlib]System.AsyncCallback callback, - object 'object') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed - { - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types.ilproj deleted file mode 100644 index e90ddd06ea..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - types - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI.il deleted file mode 100644 index 56a463547c..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI.il +++ /dev/null @@ -1,131 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} - -.assembly Types_implementI {} - - -.class interface public abstract auto ansi I {} - - -// class with public nullary ctor -.class public auto ansi beforefieldinit ClassWithCtor - extends [mscorlib]System.Object - implements I - -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// generic class with public nullary ctor -.class public auto ansi beforefieldinit GenClassWithCtor - extends [mscorlib]System.Object - implements I -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -// class without public nullary ctor -.class public auto ansi beforefieldinit ClassNoCtor - extends [mscorlib]System.Object - implements I -{ -} - -// generic class without public nullary ctor -.class public auto ansi beforefieldinit GenClassNoCtor - extends [mscorlib]System.Object - implements I -{ -} - - -// struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit NonGenStruct - extends [mscorlib]System.ValueType - implements I -{ - .pack 0 - .size 1 -} - - - -// generic struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit GenStruct - extends [mscorlib]System.ValueType - implements I -{ - .pack 0 - .size 1 -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit NonGenInterface - implements I -{ -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit GenInterface - implements I -{ -} - - -.class public auto ansi sealed Enum1 - extends [mscorlib]System.Enum -{ - .field public specialname rtspecialname int32 value__ - .field public static literal valuetype Enum1 One = int32(0x00000000) -} - - -// doesn't have public parameterless constructor -.class public auto ansi sealed Delegate1 - extends [mscorlib]System.MulticastDelegate - implements I -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor(object 'object', - native int 'method') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void Invoke() runtime managed - { - } - - .method public hidebysig newslot virtual - instance class [mscorlib]System.IAsyncResult - BeginInvoke(class [mscorlib]System.AsyncCallback callback, - object 'object') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed - { - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI.ilproj deleted file mode 100644 index 56d5b6ed3e..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - types_implementI - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI_extendC.il b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI_extendC.il deleted file mode 100644 index 7bbe76e361..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI_extendC.il +++ /dev/null @@ -1,151 +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. - -.assembly extern System.Console { } - -.assembly extern mscorlib{} - -.assembly types_implementI_extendC {} - - -.class interface public abstract auto ansi I {} - -.class public auto ansi beforefieldinit C - extends [mscorlib]System.Object - implements I - -{} - -// class with public nullary ctor -.class public auto ansi beforefieldinit ClassWithCtor - extends C - implements I - -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// class with public nullary ctor extends C but doesn't implement I -.class public auto ansi beforefieldinit ClassWithCtor2 - extends C - -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - -// generic class with public nullary ctor -.class public auto ansi beforefieldinit GenClassWithCtor - extends C - implements I -{ - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - .maxstack 8 - ldarg.0 - call instance void [mscorlib]System.Object::.ctor() - ret - } -} - - -// class without public nullary ctor -.class public auto ansi beforefieldinit ClassNoCtor - extends C - implements I -{ -} - -// generic class without public nullary ctor -.class public auto ansi beforefieldinit GenClassNoCtor - extends C - implements I -{ -} - - -// struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit NonGenStruct - extends [mscorlib]System.ValueType - implements I -{ - .pack 0 - .size 1 -} - - - -// generic struct (valuetypes have public nullary ctors by default) -.class public sequential ansi sealed beforefieldinit GenStruct - extends [mscorlib]System.ValueType - implements I -{ - .pack 0 - .size 1 -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit NonGenInterface - implements I -{ -} - -// interface without public nullary ctor -.class public abstract interface auto ansi beforefieldinit GenInterface - implements I -{ -} - - -.class public auto ansi sealed Enum1 - extends [mscorlib]System.Enum -{ - .field public specialname rtspecialname int32 value__ - .field public static literal valuetype Enum1 One = int32(0x00000000) -} - - -// doesn't have public parameterless constructor -.class public auto ansi sealed Delegate1 - extends [mscorlib]System.MulticastDelegate - implements I -{ - - .method public hidebysig specialname rtspecialname - instance void .ctor(object 'object', - native int 'method') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void Invoke() runtime managed - { - } - - .method public hidebysig newslot virtual - instance class [mscorlib]System.IAsyncResult - BeginInvoke(class [mscorlib]System.AsyncCallback callback, - object 'object') runtime managed - { - } - - .method public hidebysig newslot virtual - instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed - { - } -} diff --git a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI_extendC.ilproj b/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI_extendC.ilproj deleted file mode 100644 index 783be27964..0000000000 --- a/tests/src/Loader/classloader/generics/Constraints/ConstraintsOnType/Positive/types_implementI_extendC.ilproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - types_implementI_extendC - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 7a9bfb7d - true - true - Library - BuildOnly - 0 - - - - - False - - - - - - - - - - - - - - - - -- cgit v1.2.3