diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/WasmArgumentLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/WasmArgumentLayoutTests.cs index f3e8082e09f5a4..14f487560d8cb9 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/WasmArgumentLayoutTests.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/WasmArgumentLayoutTests.cs @@ -163,7 +163,8 @@ private ReadyToRunCompilerContext CreateWasmContext() InstructionSetSupport instructionSetSupport = new(default, default, TargetArchitecture.Wasm32); TargetDetails target = new(TargetArchitecture.Wasm32, TargetOS.Browser, TargetAbi.NativeAot, instructionSetSupport.GetVectorTSimdVector()); - ReadyToRunCompilerContext context = new(target, SharedGenericsMode.CanonicalReferenceTypes, bubbleIncludesCoreModule: true, instructionSetSupport, oldTypeSystemContext: null) + // Wasm cannot generate code at runtime, matching what crossgen2's Program computes for this target. + ReadyToRunCompilerContext context = new(target, SharedGenericsMode.CanonicalReferenceTypes, bubbleIncludesCoreModule: true, targetAllowsRuntimeCodeGeneration: false, instructionSetSupport, oldTypeSystemContext: null) { InputFilePaths = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "System.Private.CoreLib", coreLibPath } }, ReferenceFilePaths = new Dictionary(StringComparer.OrdinalIgnoreCase),