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

pointer.cs « tests « mono - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b425801b481a24cabe96a67341e49bbc10f80030 (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;

public class Test {

	public static IntPtr to_intptr (int value)
	{
		return new IntPtr (value);
	}
	
        unsafe public static int Main () {
		int num = 0;

		num++;
		IntPtr a = to_intptr (1);
		if ((int)a != 1)
			return num;
		
		num++;
		if (sizeof (void*) != sizeof(IntPtr))
			return num;

		num++;
		if (sizeof (byte*) != sizeof (void *))
			return num;

		num++;
		if (sizeof (int*) != sizeof (int *))
			return num;

		num++;
		if (sizeof (IntPtr) != 4 && sizeof (IntPtr) != 8)
			return num;

                return 0;
        }
}