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

test-404.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c1fa56f67949c455ddc6742dfa4e79b86bfb1773 (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
// Compiler options: -unsafe

unsafe class X {
	static int v;
	static int v_calls;
	
	static int* get_v ()
	{
		v_calls++;
	        fixed (int* ptr = &v)
		{
		    return ptr;
		}
	}
	
	public static int Main ()
	{
		if ((*get_v ())++ != 0)
			return 1;
		if (v != 1)
			return 2;
		if (v_calls != 1)
			return 3;
		return 0;
	}
}