Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-anon-09.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f3519660b7de651e2ce82e2fb496c3d5c57c4513 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//
// Tests unary mutator operators on captured variables
//
using System;

class X {
	delegate void D ();

	static int gt, gj;
    
	public static int Main ()
	{
		int times = 0;
		
		D d = delegate {
		    int t = times++;
		    int j = ++times;

		    gt = t;
		    gj = j;
		};
		d ();

		if (gt != 0)
			return 1;
		if (gj != 2)
			return 2;

		return 0;
	}
}