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

gtest-585.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ff2a16ca8cafa5acf1741b45c8faf82e6fa99a03 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;

struct S
{
	public static implicit operator int (S arg)
	{
		throw new ApplicationException ();
	}
}

struct S2
{
	public static implicit operator int?(S2 arg)
	{
		return 10000;
	}

	public static implicit operator uint?(S2 arg)
	{
		throw new ApplicationException ();
	}
}

public struct S3
{
	public static int counter;
	
	public static implicit operator string (S3 s3)
	{
		counter++;
		return "";
	}
}

class C
{
	public static int Main ()
	{
		S? s = null;
		bool res = s > 1;
		if (res)
			return 1;

		S2 s2 = new S2 ();

		var b = s2 >> 3;
		if (b != 1250)
			return 2;

		var b2 = s2 >> s2;
		if (b2 != 0)
			return 3;

		var b3 = s2 + 1;
		if (b3 != 10001)
			return 4;

		var s3 = new S3 ();
		if ((s3 == null) != false)
			return 5;

		if ((s3 != null) != true)
			return 6;
		
		if (S3.counter != 2)
			return 7;

		Console.WriteLine ("ok");
		return 0;
	}
}