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

gtest-386.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f7c948e64544c903b04bdd13e2ef6d5a719514f5 (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
using System;
using System.Linq.Expressions;

public struct MyType
{
	int value;

	public MyType (int value)
	{
		this.value = value;
	}
	public static MyType operator - (MyType a)
	{
		return new MyType (-a.value);
	}
}

class C
{
	public static int Main ()
	{
		MyType? x = null;
		MyType? y = -x;
		
		checked {
			float? f = float.MinValue;
			f = -f + 1;
			int? i = int.MinValue;
			try {
				i = -i;
				return 1;
			} catch (OverflowException) { }
		}		
		
		return 0;
	}
}