[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / tests / test-anon-33.cs
blob46d65b71fce93f0bb3ae70a216d9222599789c8c
1 //
2 // This test showed that there were cases where there was no
3 // shared "ScopeInfo", and that we could not root and keep a "topmost"
4 // variable in the compiler for a CaptureContext.
5 //
6 // This illustrates two roots of captured scopes, independent of
7 // each other
8 //
10 using System;
12 delegate void Do ();
14 class T {
15 static void doit (int v) {
16 Console.WriteLine (v);
18 public static void Main () {
19 Do[] arr = new Do [5];
20 for (int i = 0; i < 5; ++i) {
21 arr [i] = delegate {doit (i);};
23 for (int i = 0; i < 5; ++i) {
24 arr [i] ();
27 for (int j = 0; j < 5; ++j) {
28 arr [j] = delegate {doit (j);};