Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

34 lines
459 B
C#

// Compiler options: -unsafe
// this tests making a pointer to a pointer
using System;
unsafe class Foo
{
public static int Main ()
{
int a;
int *b;
int **c;
a = 42;
b = &a;
c = &b;
Console.WriteLine ("*c == b : {0}", *c == b);
Console.WriteLine ("**c == a : {0}", **c == a);
if (*c == b && **c == a)
{
Console.WriteLine ("Test passed");
return 0;
}
else
{
Console.WriteLine ("Test failed");
return 1;
}
}
}