[runtime] Remove all NACL support. It was unmaintained for a long time. (#4955)
[mono.git] / mono / tests / test-inline-call-stack-library.cs
1 using System;
2 using System.Diagnostics;
3 using System.Reflection;
4
5 namespace Library {
6         public class StaticFlag {
7                 private static bool _flag = false;
8                 public static bool Flag {
9                         get {
10                                 return _flag;
11                         }
12                         set {
13                                 _flag = value;
14                         }
15                 }
16                 
17         }
18         
19         public class CallingAssemblyDependant {
20                 private string _calledFrom;
21                 public string CalledFrom {
22                         get {
23                                 return _calledFrom;
24                         }
25                 }
26                 
27                 public CallingAssemblyDependant () {
28                         _calledFrom = Assembly.GetCallingAssembly ().GetName ().Name;
29                 }
30                 
31                 public static string CalledFromLibrary () {
32                         return new CallingAssemblyDependant ().CalledFrom;
33                 }
34         }
35         
36         public class ResourceRelaxedFieldInit {         
37                 private static ResourceRelaxedFieldInit _singleResource = new ResourceRelaxedFieldInit ();
38                 public static ResourceRelaxedFieldInit Single {
39                         get {
40                                 return _singleResource;
41                         }
42                 }
43                 
44                 private bool _flag;
45                 public bool Flag {
46                         get {
47                                 return _flag;
48                         }
49                 }
50                 
51                 public ResourceRelaxedFieldInit () {
52                         _flag = StaticFlag.Flag;
53                 }
54         }
55         
56         public class ResourceStrictFieldInit {          
57                 private static ResourceStrictFieldInit _singleResource = new ResourceStrictFieldInit ();
58                 public static ResourceStrictFieldInit Single {
59                         get {
60                                 return _singleResource;
61                         }
62                 }
63                 
64                 private bool _flag;
65                 public bool Flag {
66                         get {
67                                 return _flag;
68                         }
69                 }
70                 
71                 public ResourceStrictFieldInit () {
72                         _flag = StaticFlag.Flag;
73                 }
74                 
75                 static ResourceStrictFieldInit () {
76                 }
77         }
78         
79         public class InlinedMethods {
80                 public static MethodBase GetCurrentMethod () {
81                         return MethodBase.GetCurrentMethod ();
82                 }
83                 public static Assembly GetExecutingAssembly () {
84                         return Assembly.GetExecutingAssembly ();
85                 }
86                 public static Assembly GetCallingAssembly () {
87                         return Assembly.GetCallingAssembly ();
88                 }
89                 public static Assembly CallCallingAssembly () {
90                         return GetCallingAssembly ();
91                 }
92                 public static StackFrame GetStackFrame () {
93                         return new StackFrame ();
94                 }
95                 public static ResourceRelaxedFieldInit GetResourceRelaxedFieldInit () {
96                         return ResourceRelaxedFieldInit.Single;
97                 }
98                 public static ResourceStrictFieldInit GetResourceStrictFieldInit () {
99                         return ResourceStrictFieldInit.Single;
100                 }
101         }
102 }