Skip to content

Commit

Permalink
updates test expectations to match new format
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianoc committed Aug 2, 2023
1 parent 628214e commit 71b9c5d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,30 @@ IL_0006: add
IL_0007: stloc V_0
IL_000b: ldloc V_0
IL_000f: ldc.i4 0
IL_0014: beq.s IL_0036
IL_0014: beq.s IL_0031
IL_0016: ldloc V_0
IL_001a: ldc.i4 1
IL_001f: beq.s IL_0036
IL_001f: beq.s IL_0031
IL_0021: ldloc V_0
IL_0025: ldc.i4 2
IL_002a: beq.s IL_004f
IL_002c: br IL_0057
IL_0031: br IL_0064
IL_0036: nop
IL_0037: ldarg.1
IL_0038: ldc.i4 2
IL_003d: add
IL_003e: call System.Void System.Console::WriteLine(System.Int32)
IL_0043: ldc.i4 2
IL_0048: starg.s 1
IL_004a: br IL_0064
IL_004f: nop
IL_0050: ldc.i4 1
IL_0055: neg
IL_0056: ret
IL_0057: nop
IL_0058: ldc.i4 3
IL_005d: starg.s 1
IL_005f: br IL_0064
IL_0064: nop
IL_0065: ldarg.1
IL_0066: ret
IL_002a: beq.s IL_004a
IL_002c: br IL_0052
IL_0031: nop
IL_0032: ldarg.1
IL_0033: ldc.i4 2
IL_0038: add
IL_0039: call System.Void System.Console::WriteLine(System.Int32)
IL_003e: ldc.i4 2
IL_0043: starg.s 1
IL_0045: br IL_005f
IL_004a: nop
IL_004b: ldc.i4 1
IL_0050: neg
IL_0051: ret
IL_0052: nop
IL_0053: ldc.i4 3
IL_0058: starg.s 1
IL_005a: br IL_005f
IL_005f: nop
IL_0060: ldarg.1
IL_0061: ret
3 changes: 1 addition & 2 deletions Cecilifier.Core.Tests/Tests/Unit/Miscellaneous.Statements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@ void M()
\s+il_M_7.Emit\(OpCodes.Ldloc, l_switchCondition_13\);
\s+il_M_7.Emit\(OpCodes.Ldc_I4, 2\);
\s+il_M_7.Emit\(OpCodes.Beq_S, lbl_caseCode_1_16\);
\s+il_M_7.Emit\(OpCodes.Br, lbl_caseCode_2_17\);
\s+il_M_7.Emit\(OpCodes.Br, lbl_endOfSwitch_14\);
\s+//case 1: \(code\)
\s+il_M_7.Append\(lbl_caseCode_0_15\);
\s+il_M_7.Emit\(OpCodes.Ldstr, "C1"\);
Expand Down
1 change: 1 addition & 0 deletions Cecilifier.Core/AST/StatementVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public override void VisitSwitchStatement(SwitchStatementSyntax node)
currentLabelIndex++;
}

Context.WriteNewLine();
Context.WriteComment("End of switch");
AddCecilExpression($"{_ilVar}.Append({endOfSwitchLabel});");

Expand Down

0 comments on commit 71b9c5d

Please sign in to comment.