Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the only ilproj test that uses multiple command-line variants #61750

Merged
merged 1 commit into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 52 additions & 17 deletions src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491.il
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
// During the merge gtNewTempAssign does not expect the source value of TYP_SIMD16
// and the destination value of TYP_STRUCT.

.assembly extern System.Console
{
}

.assembly extern System.Runtime
{
}
Expand Down Expand Up @@ -96,37 +100,68 @@
IL_0009: ret
}

.method public hidebysig static int32 Main(string[] args) cil managed
.method public hidebysig static int32 MultipleReturns() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldstr "MultipleReturns"
IL_0006: call int32 [System.Runtime]System.Array::IndexOf<string>(!!0[], !!0)
IL_000b: ldc.i4.m1
IL_000c: beq.s IL_001b

IL_000e: ldc.i4 0x677b
IL_0013: call valuetype GitHub_26491/ReturnType GitHub_26491::MultipleReturns(int32)
IL_0018: pop
IL_0019: br.s IL_0037

IL_001b: ldarg.0
IL_001c: ldstr "SingleReturnSynchronized"
IL_0021: call int32 [System.Runtime]System.Array::IndexOf<string>(!!0[], !!0)
IL_0026: ldc.i4.m1
IL_0027: beq.s IL_0031
IL_0037: ldc.i4.s 100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IL_0037 label definitely doesn't belong here - but I think it's okay and not worth trouble of re-doing ilasm/ildasm round trip to get them right.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe, thanks Egor for your feedback, as you can certainly see I just manually copied over the different sections of the previously main IL to the individual methods. This one is definitely a singleton but there are some tests that specify command-line arguments even though they don't refer to "base tests" to run, I'm investigating now what exactly happens there and it may have further implications on this aspect of il test refactoring.

IL_0039: ret
}

.method public hidebysig static int32 SingleReturnSynchronized() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
IL_0029: call valuetype GitHub_26491/ReturnType GitHub_26491::SingleReturnSynchronized()
IL_002e: pop
IL_002f: br.s IL_0037
IL_0037: ldc.i4.s 100
IL_0039: ret
}

.method public hidebysig static int32 SingleReturn() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
IL_0031: call valuetype GitHub_26491/ReturnType GitHub_26491::SingleReturn()
IL_0036: pop
IL_0037: ldc.i4.s 100
IL_0039: ret
}

.method public hidebysig static int32 Main() cil managed
{
.entrypoint
.maxstack 8

ldstr "MultipleReturns"
call void [System.Console]System.Console::WriteLine(string)
call int32 GitHub_26491::MultipleReturns()
ldc.i4 100
bne.un FAIL

ldstr "SingleReturnSynchronized"
call void [System.Console]System.Console::WriteLine(string)
call int32 GitHub_26491::SingleReturnSynchronized()
ldc.i4 100
bne.un FAIL

ldstr "SingleReturn"
call void [System.Console]System.Console::WriteLine(string)
call int32 GitHub_26491::SingleReturn()
ldc.i4 100
bne.un FAIL

ldc.i4 100
ret

FAIL:
ldc.i4 101
ret
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestExecutionArguments>MultipleReturns</CLRTestExecutionArguments>
</PropertyGroup>
<ItemGroup>
<Compile Include="GitHub_26491.il" />
Expand Down

This file was deleted.