Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-691.cs
1 // Compiler options: -unsafe
2
3 using System;
4
5 namespace ConsoleApplication6
6 {
7         unsafe class Program
8         {
9                 static int a;
10                 static int* the_ptr = (int*) 0xdeadbeaf;
11                 static int** the_pptr = (int**) 0xdeadbeaf;
12
13                 public static void Main ()
14                 {
15                         Console.WriteLine ("TEST: {0:x}", new IntPtr (the_pptr).ToInt64 ());
16
17                         fixed (int* a_ptr = &a) {
18                                 Console.WriteLine (new IntPtr (a_ptr));
19
20                                 int*[] array = { the_ptr };
21                                 int*[] array2 = { a_ptr };
22                                 int* ptr = the_ptr;
23                                 int** pptr = the_pptr;
24
25                                 fixed (int** pptr2 = &the_ptr) {
26                                         Console.WriteLine (new IntPtr (pptr));
27                                 }
28                         }
29                 }
30         }
31 }