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

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

using System;
using System.Runtime.InteropServices;

class UnsafeTest
{
	[StructLayout (LayoutKind.Sequential)]
	public unsafe struct Foo
	{
		public Bar* bar;
	}

	[StructLayout (LayoutKind.Sequential)]
	public struct Bar
	{
		public Foo foo;
	}

	unsafe public static void Main ()
	{
		Console.WriteLine (sizeof (Foo));
	}
}