2010-05-11 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / test-inline-call-stack-library.cs
blob3e467a41b55c28d399bd6e83ceed6b0a2f5b7822
1 using System;
2 using System.Diagnostics;
3 using System.Reflection;
5 namespace Library {
6 public class StaticFlag {
7 private static bool _flag = false;
8 public static bool Flag {
9 get {
10 return _flag;
12 set {
13 _flag = value;
19 public class CallingAssemblyDependant {
20 private string _calledFrom;
21 public string CalledFrom {
22 get {
23 return _calledFrom;
27 public CallingAssemblyDependant () {
28 _calledFrom = Assembly.GetCallingAssembly ().GetName ().Name;
31 public static string CalledFromLibrary () {
32 return new CallingAssemblyDependant ().CalledFrom;
36 public class ResourceRelaxedFieldInit {
37 private static ResourceRelaxedFieldInit _singleResource = new ResourceRelaxedFieldInit ();
38 public static ResourceRelaxedFieldInit Single {
39 get {
40 return _singleResource;
44 private bool _flag;
45 public bool Flag {
46 get {
47 return _flag;
51 public ResourceRelaxedFieldInit () {
52 _flag = StaticFlag.Flag;
56 public class ResourceStrictFieldInit {
57 private static ResourceStrictFieldInit _singleResource = new ResourceStrictFieldInit ();
58 public static ResourceStrictFieldInit Single {
59 get {
60 return _singleResource;
64 private bool _flag;
65 public bool Flag {
66 get {
67 return _flag;
71 public ResourceStrictFieldInit () {
72 _flag = StaticFlag.Flag;
75 static ResourceStrictFieldInit () {
79 public class InlinedMethods {
80 public static MethodBase GetCurrentMethod () {
81 return MethodBase.GetCurrentMethod ();
83 public static Assembly GetExecutingAssembly () {
84 return Assembly.GetExecutingAssembly ();
86 public static Assembly GetCallingAssembly () {
87 return Assembly.GetCallingAssembly ();
89 public static Assembly CallCallingAssembly () {
90 return GetCallingAssembly ();
92 public static StackFrame GetStackFrame () {
93 return new StackFrame ();
95 public static ResourceRelaxedFieldInit GetResourceRelaxedFieldInit () {
96 return ResourceRelaxedFieldInit.Single;
98 public static ResourceStrictFieldInit GetResourceStrictFieldInit () {
99 return ResourceStrictFieldInit.Single;