Skip to content

Commit 5fe365d

Browse files
lewingCopilot
andcommitted
Add Wasm32 cases to the Int128/UInt128 architecture layout tests
Covers the new Wasm32 branch in Int128FieldLayoutAlgorithm alongside the existing ARM/ARM64/X86/X64 cases. Both new cases fail without the layout change (alignment 16 rather than 8). Co-authored-by: Copilot App <[email protected]> Copilot-Session: 50ddfb2c-b6f8-4847-81e7-44d37d44a175
1 parent 6189b46 commit 5fe365d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ArchitectureSpecificFieldLayoutTests.cs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class ArchitectureSpecificFieldLayoutTests
2222
private ModuleDesc _testModuleARM;
2323
private TestTypeSystemContext _contextARM64;
2424
private ModuleDesc _testModuleARM64;
25+
private TestTypeSystemContext _contextWasm32;
26+
private ModuleDesc _testModuleWasm32;
2527

2628
public ArchitectureSpecificFieldLayoutTests()
2729
{
@@ -60,6 +62,12 @@ public ArchitectureSpecificFieldLayoutTests()
6062
_contextARM64.SetSystemModule(systemModuleARM64);
6163

6264
_testModuleARM64 = systemModuleARM64;
65+
66+
_contextWasm32 = new TestTypeSystemContext(TargetArchitecture.Wasm32);
67+
var systemModuleWasm32 = _contextWasm32.CreateModuleForSimpleName("CoreTestAssembly");
68+
_contextWasm32.SetSystemModule(systemModuleWasm32);
69+
70+
_testModuleWasm32 = systemModuleWasm32;
6371
}
6472

6573
[Fact]
@@ -501,11 +509,13 @@ public void TestAlignmentBehavior_AutoAlignmentRules(string wrapperType, int[] a
501509
[InlineData("StructStructByte_Int128StructAuto", "X86", 16, 32)]
502510
[InlineData("StructStructByte_Int128StructAuto", "X64Linux", 16, 32)]
503511
[InlineData("StructStructByte_Int128StructAuto", "X64Windows", 16, 32)]
512+
[InlineData("StructStructByte_Int128StructAuto", "Wasm32", 8, 24)]
504513
[InlineData("StructStructByte_UInt128StructAuto", "ARM64", 16, 32)]
505514
[InlineData("StructStructByte_UInt128StructAuto", "ARM", 8, 24)]
506515
[InlineData("StructStructByte_UInt128StructAuto", "X86", 16, 32)]
507516
[InlineData("StructStructByte_UInt128StructAuto", "X64Linux", 16, 32)]
508517
[InlineData("StructStructByte_UInt128StructAuto", "X64Windows", 16, 32)]
518+
[InlineData("StructStructByte_UInt128StructAuto", "Wasm32", 8, 24)]
509519
// Variation of TestAlignmentBehavior_AutoAlignmentRules above that is able to deal with os specific behavior
510520
public void TestAlignmentBehavior_AutoAlignmentRulesWithOSDependence(string wrapperType, string osArch, int alignment, int size)
511521
{
@@ -530,6 +540,9 @@ public void TestAlignmentBehavior_AutoAlignmentRulesWithOSDependence(string wrap
530540
case "X86":
531541
testModule = _testModuleX86;
532542
break;
543+
case "Wasm32":
544+
testModule = _testModuleWasm32;
545+
break;
533546
default:
534547
throw new Exception();
535548
}

0 commit comments

Comments
 (0)