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

test-801.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c204848ec2f87a7b2152052230da81ce22ff0a3 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;

class C
{
	public enum E
	{
		V_0 = 10,
		V_1	= 50,
		V_2 = 80
	}
	
	public static implicit operator E (C x)
	{
		return E.V_2;
	}

	public static implicit operator int (C x)
	{
		return 1;
	}

	public static int Main ()
	{
		var v = new C ();
		int i = E.V_1 - v;
		if (i != -30)
			return 1;
		
		i = v - E.V_1;
		if (i != 30)
			return 10;
		
		E e = E.V_1 + v;
		if (e != (E) 51)
			return 2;
		
		e = v + E.V_0;
		if (e != (E) 11)
			return 3;
		
		bool b = E.V_2 > v;
		if (b)
			return 4;
		
		int iv = 900;
		e = iv - E.V_1;
		if (e != (E)850)
			return 5;
		
		i = v - E.V_1;
		if (i != (int) 30)
			return 6;

		return 0;
	}
}