[sgen] Fix pointer access.
[mono.git] / mcs / tests / test-primary-ctor-07.cs
1 using System;
2
3 struct S (int x)
4 {
5         public int y = x;
6
7         public S (char x)
8                 : this (1)
9         {
10         }
11
12         static S ()
13         {
14         }
15 }
16
17 struct S2 (int arg)
18 {
19         public readonly int v = arg;
20 }
21
22 struct S3 (string s = "arg")
23 {
24         public readonly string V2 = s;
25
26         public S3 (int i, string s = "arg2")
27                 : this (s)
28         {
29         }
30 }
31
32 class X
33 {
34         public static int Main ()
35         {
36                 if (new S (-5).y != -5)
37                         return 1;
38
39                 if (new S ('x').y != 1)
40                         return 2;
41
42                 if (new S2 (2).v != 2)
43                         return 3;
44
45                 if (new S3 ("x").V2 != "x")
46                         return 4;
47
48                 if (new S3 (0).V2 != "arg2")
49                         return 5;
50
51                 return 0;
52         }
53 }