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

test-691.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4fafcf7e531b6472e9c27cc4f66bd0740e8e1163 (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
// Compiler options: -unsafe

using System;

namespace ConsoleApplication6
{
	unsafe class Program
	{
		static int a;
		static int* the_ptr = (int*) 0xdeadbeaf;
		static int** the_pptr = (int**) 0xdeadbeaf;

		public static void Main ()
		{
			Console.WriteLine ("TEST: {0:x}", new IntPtr (the_pptr).ToInt64 ());

			fixed (int* a_ptr = &a) {
				Console.WriteLine (new IntPtr (a_ptr));

				int*[] array = { the_ptr };
				int*[] array2 = { a_ptr };
				int* ptr = the_ptr;
				int** pptr = the_pptr;

				fixed (int** pptr2 = &the_ptr) {
					Console.WriteLine (new IntPtr (pptr));
				}
			}
		}
	}
}