Skip to content

Commit

Permalink
Remove command-line arguments from Main methods in ILPROj projects (#…
Browse files Browse the repository at this point in the history
…64482)

In my recent change I fixed C# test projects to stop using
command-line arguments. This follow-up change complements it by
applying the same transformation to IL projects. In most cases
the arguments were ignored so the transformation was trivial; in
the special case of twoEndFinallys.il the argument array is
passed to the method TwoEndFinallys so I patched it to allocate
a zero-sized string array instead (there are no tests passing
actual command-line arguments to the test app).

Thanks

Tomas
  • Loading branch information
trylek committed Jan 29, 2022
1 parent 874d6a3 commit 77f4d7a
Show file tree
Hide file tree
Showing 28 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/eh/basics/emptyfinally.il
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@


.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/eh/deadcode/deadcodeincatch.il
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
} // end of method Class1::inFinally

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
extends [mscorlib]System.Object
{
.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
ret
}
.method private hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/eh/leaves/2branchesoutoftry.il
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
extends [mscorlib]System.Object
{
.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/eh/leaves/backwardleaveincatch.il
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
extends [mscorlib]System.Object
{
.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/eh/leaves/forwardleaveincatch.il
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/eh/leaves/leaveinsameregion.il
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/eh/leaves/leaveintotrybody.il
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}

.method public hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
} // end of method Test::.ctor

.method private hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand All @@ -59,7 +59,8 @@
// Code size 23 (0x17)
.maxstack 2
.locals init (class Test_twoEndFinallys V_0)
IL_0000: ldarg.0
ldc.i4.s 0
IL_0000: newarr [mscorlib]System.String
IL_0001: call class Test_twoEndFinallys Test_twoEndFinallys::TwoEndFinallys(string[])
IL_0006: stloc.0
IL_0007: ldloc.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
}

.method private hidebysig static int32
Main(string[] args) cil managed
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/nonvirtualcall/classic.il
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@
IL_000e: ret
} // end of method Program::CallFromInsideGrandChild

.method public hidebysig static int32 Main(string[] args) cil managed
.method public hidebysig static int32 Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/nonvirtualcall/delegate.il
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@
IL_007f: ret
} // end of method Program::CallDelegateFromGrandChild

.method public hidebysig static int32 Main(string[] args) cil managed
.method public hidebysig static int32 Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/nonvirtualcall/generics.il
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@
IL_000e: ret
} // end of method Program::CallFromInsideGrandChild

.method public hidebysig static int32 Main(string[] args) cil managed
.method public hidebysig static int32 Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/nonvirtualcall/generics2.il
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@
IL_000e: ret
} // end of method Program::CallFromInsideGrandChild

.method public hidebysig static int32 Main(string[] args) cil managed
.method public hidebysig static int32 Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/nonvirtualcall/tailcall.il
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@
IL_000e: ret
} // end of method Program::CallFromInsideGrandChild

.method public hidebysig static int32 Main(string[] args) cil managed
.method public hidebysig static int32 Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Methodical/nonvirtualcall/valuetype.il
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
IL_0037: ret
} // end of method Program::CallDummy

.method public hidebysig static int32 Main(string[] args) cil managed
.method public hidebysig static int32 Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
Expand Down

0 comments on commit 77f4d7a

Please sign in to comment.