[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / tests / gtest-iter-32.cs
blob04e80fe7439806beb86350db607b11b4ae327902
1 using System.Collections.Generic;
3 class TestGoto
5 static int x = 2;
7 public static void Main(string[] args)
9 foreach (bool b in test())
11 if (x != 0)
12 throw new System.Exception ();
15 static IEnumerable<bool> setX()
17 x = 1;
18 try {
19 yield return true;
20 } finally {
21 x = 0;
25 static IEnumerable<bool> test()
27 foreach (bool b in setX()) {
28 yield return true;
29 // Change "goto label" to "break" to show the correct result.
30 goto label;
32 label:
33 yield break;