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

unsafe-4.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 730bb4915a194e49d1694aa76c5380c76d1aeffa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
unsafe class X {
	static int v;
	static int v_calls;
	
	static int* get_v ()
	{
		v_calls++;
		return &v;
	}
	
	static int Main ()
	{
		if ((*get_v ())++ != 0)
			return 1;
		if (v != 1)
			return 2;
		if (v_calls != 1)
			return 3;
		return 0;
	}
}