From 2fc318da7d2897a089dafc8cc714437fb55399f1 Mon Sep 17 00:00:00 2001 From: Vitek Karas <10670590+vitek-karas@users.noreply.github.com> Date: Mon, 17 Jul 2023 01:06:52 -0700 Subject: [PATCH] Run NativeAOT tests when ILLink changes (#88934) NativeAOT uses code from ILLinker - specifically we share lot of tests. So if these change we want to make sure it didn't break their usage in NativeAOT. The comment change in the tests is to trigger this new rule in the CI - but we can keep the comment regardless. --- eng/pipelines/runtime.yml | 2 ++ .../test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 4d75c6feeec7a..8edd9927a2c0a 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -346,9 +346,11 @@ extends: buildArgs: -s clr.aot+clr.iltools+libs+clr.toolstests -c $(_BuildConfig) -test enablePublishTestResults: true testResultsFormat: 'xunit' + # We want to run AOT tests when illink changes because there's share code and tests from illink which are used by AOT condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true), eq(variables['isRollingBuild'], true)) # Build Mono AOT offset headers once, for consumption elsewhere diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs index 8a241817c7c40..7f2ccf14eba3d 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs @@ -86,7 +86,7 @@ static void TestArrayWithInitializerMultipleElementsStaticType () Type[] arr = new Type[] { typeof (TestType), typeof (TProperties), typeAll }; arr[0].RequiresAll (); arr[1].RequiresPublicProperties (); - arr[1].RequiresPublicFields (); // Should warn + arr[1].RequiresPublicFields (); // Should warn - member types mismatch arr[2].RequiresAll (); arr[3].RequiresPublicMethods (); // Should warn - unknown value at this index }