From bab1596eb90d3d0a7d8db1e0c4dc3fcc2694f107 Mon Sep 17 00:00:00 2001 From: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com> Date: Thu, 2 Feb 2023 06:41:15 +0300 Subject: [PATCH] Delete !CODEGEN_CPP ifdefs from NAOT smoke tests (#81474) --- src/tests/nativeaot/SmokeTests/Reflection/Reflection.cs | 13 +------------ src/tests/nativeaot/SmokeTests/UnitTests/Delegates.cs | 3 --- src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs | 3 +-- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/tests/nativeaot/SmokeTests/Reflection/Reflection.cs b/src/tests/nativeaot/SmokeTests/Reflection/Reflection.cs index 697b449..6717aca 100644 --- a/src/tests/nativeaot/SmokeTests/Reflection/Reflection.cs +++ b/src/tests/nativeaot/SmokeTests/Reflection/Reflection.cs @@ -37,11 +37,8 @@ internal static class ReflectionTest #if !OPTIMIZED_MODE_WITHOUT_SCANNER TestContainment.Run(); TestInterfaceMethod.Run(); - // Need to implement RhGetCodeTarget for CppCodeGen -#if !CODEGEN_CPP TestByRefLikeTypeMethod.Run(); #endif -#endif TestILScanner.Run(); TestUnreferencedEnum.Run(); @@ -76,14 +73,13 @@ internal static class ReflectionTest TestInvokeMemberParamsCornerCase.Run(); TestDefaultInterfaceInvoke.Run(); TestCovariantReturnInvoke.Run(); -#if !CODEGEN_CPP TypeConstructionTest.Run(); TestThreadStaticFields.Run(); TestByRefReturnInvoke.Run(); TestAssemblyLoad.Run(); -#endif TestBaseOnlyUsedFromCode.Run(); TestEntryPoint.Run(); + return 100; } @@ -249,7 +245,6 @@ internal static class ReflectionTest throw new Exception(); } -#if !CODEGEN_CPP { MethodInfo helloMethod = typeof(InvokeTestsGeneric).GetTypeInfo().GetDeclaredMethod("GetHello"); string result = (string)helloMethod.Invoke(new InvokeTestsGeneric(), new object[] { "world" }); @@ -277,7 +272,6 @@ internal static class ReflectionTest if (result != "Hello 1 System.Double") throw new Exception(); } -#endif } } @@ -1106,12 +1100,9 @@ internal static class ReflectionTest if (!HasTypeHandle(usedNestedType)) throw new Exception($"{nameof(NeverUsedContainerType.UsedNestedType)} should have an EEType"); - // Need to implement exceptions for CppCodeGen -#if !CODEGEN_CPP // But the containing type doesn't need an EEType if (HasTypeHandle(neverUsedContainerType)) throw new Exception($"{nameof(NeverUsedContainerType)} should not have an EEType"); -#endif } } @@ -1408,7 +1399,6 @@ internal static class ReflectionTest throw new Exception("PartialCanon"); } -#if !CODEGEN_CPP // https://github.com/dotnet/corert/issues/7799 Console.WriteLine("Search in system assembly"); { Type t = Type.GetType("System.Runtime.CompilerServices.SuppressIldasmAttribute", throwOnError: false); @@ -1431,7 +1421,6 @@ internal static class ReflectionTest throw new Exception("CompilerGlobalScopeAttribute"); } #endif -#endif Console.WriteLine("Enum.GetValues"); { diff --git a/src/tests/nativeaot/SmokeTests/UnitTests/Delegates.cs b/src/tests/nativeaot/SmokeTests/UnitTests/Delegates.cs index 4280753..2617cb5 100644 --- a/src/tests/nativeaot/SmokeTests/UnitTests/Delegates.cs +++ b/src/tests/nativeaot/SmokeTests/UnitTests/Delegates.cs @@ -51,10 +51,7 @@ public class Delegates result = Fail; } -#if !CODEGEN_CPP TestLinqExpressions.Run(); -#endif - TestDefaultInterfaceMethods.Run(); return result; diff --git a/src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs b/src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs index dffc859..2aa1bd0 100644 --- a/src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs +++ b/src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs @@ -50,13 +50,12 @@ class Generics TestGvmLookupDependency.Run(); TestInvokeMemberCornerCaseInGenerics.Run(); TestRefAny.Run(); -#if !CODEGEN_CPP TestNullableCasting.Run(); TestVariantCasting.Run(); TestMDArrayAddressMethod.Run(); TestNativeLayoutGeneration.Run(); TestByRefLikeVTables.Run(); -#endif + return 100; } -- 2.7.4