[eglib] In AIX/generic POSIX, handle null addresses better (#17892)
[mono-project.git] / mcs / tests / test-anon-123.cs
blob45aab27c0a5afd183592b5421086a2496a8d234b
1 // Compiler options: -langversion:latest
2 // Cloning tests
4 using System;
5 using System.Collections.Generic;
7 class MemberAccessData
9 public volatile uint VolatileValue;
10 public string [] StringValues;
11 public List<string> ListValues;
13 int? mt;
14 public int? MyTypeProperty {
15 set {
16 mt = value;
18 get {
19 return mt;
24 enum E
26 E1,
27 E2,
31 public class B
33 protected virtual void BaseM ()
38 public class C : B
40 delegate void D ();
42 static void Test (D d)
46 static void Test (Action<E> func)
48 func (E.E1);
51 void InstanceTests ()
53 Test (() => base.BaseM ());
56 public static void Main ()
58 Exception diffException;
60 Test (() => {
61 diffException = null;
62 try {
63 } catch (Exception ex) {
64 diffException = ex;
65 } finally {
68 try {
69 } catch {
71 });
73 int[] i_a = new int [] { 1,2,3 };
75 Test (() => {
76 foreach (int t in i_a) {
78 });
80 Test (() => {
81 Console.WriteLine (typeof (void));
82 });
84 Test (() => {
85 Console.WriteLine (typeof (Func<,>));
86 });
88 Test (() => {
89 object o = new List<object> { "Hello", "", null, "World", 5 };
90 });
92 Test (() => {
93 var v = new MemberAccessData {
94 VolatileValue = 2, StringValues = new string [] { "sv" }, MyTypeProperty = null
96 });
98 Test (x => {
99 switch (x) {
100 case E.E1:
101 goto case E.E2;
102 case E.E2:
103 break;
104 default:
105 break;
109 Test (() => {
110 char ch = default;
113 var c = new C ();
114 c.InstanceTests ();