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

test-59.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9c0b24dcc573a98a686f7eb87fccfc16c9e22cc1 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//
// Tests the varios type conversions.
//
using System;

class X {

	static int test_explicit ()
	{
		object x_int = 1;
		object x_uint_1 = 1u;
		object x_uint_2 = 1U;
		object x_long_1 = 1l;
		object x_long_2 = 1L;
		object x_ulong_1 = 1ul;
		object x_ulong_2 = 1UL;
		object x_ulong_3 = 1lu;
		object x_ulong_4 = 1Lu;
		object x_ulong_5 = 1LU;

		if (!(x_int is int))
			return 1;

		if (!(x_uint_1 is uint))
			return 2;

		if (!(x_uint_2 is uint))
			return 3;

		if (!(x_long_1 is long))
			return 5;

		if (!(x_long_2 is long))
			return 6;

		if (!(x_ulong_1 is ulong))
			return 7;

		if (!(x_ulong_2 is ulong))
			return 8;
		
		if (!(x_ulong_3 is ulong))
			return 9;

		if (!(x_ulong_4 is ulong))
			return 10;

		if (!(x_ulong_5 is ulong))
			return 11;

		return 0;

	}

	static int test_implicit ()
	{
		object i_int = 1;
		object i_uint = 0x80000000;
		object i_long = 0x100000000;
		object i_ulong = 0x8000000000000000;

		if (!(i_int is int))
			return 1;
		if (!(i_uint is uint))
			return 2;
		if (!(i_long is long))
			return 3;
		if (!(i_ulong is ulong))
			return 4;

		return 0;
	}
	
	public static int Main ()
	{
		int v;
		v = test_explicit ();

		if (v != 0)
			return v;

		v = test_implicit ();
		if (v != 0)
			return 20 + v;

		//
		// Just a compilation fix: 21418
		//
		ulong l = 1;
		if (l != 0L)
			;


		// This was a compilation bug, error: 57522
		ulong myulog = 0L;

		Console.WriteLine ("Tests pass");
		return 0;
	}
}