[mono-api-info] First filter, then order, and use ordinal comparison.
[mono-project.git] / mono / tests / thread-static-init.cs
blob34131596fef0070cf0489478a90f926e90362e0b
1 using System;
2 using System.Runtime.InteropServices;
4 class Foo {
5 [ThreadStatic]
6 public static int foo;
9 class X {
11 static int Main ()
13 Foo.foo = 1;
14 new Foo ();
15 Bar ();
17 return Bug34598 ();
20 static int Bug34598 ()
22 if (Test.Zero.ToString () != "0")
23 return 1;
24 if (Test.One.ToString () != "1")
25 return 2;
26 if (Test.Two.ToString () != "2")
27 return 3;
29 if (Test2.Zero.ToString () != "0")
30 return 4;
31 if (Test2.One.ToString () != "1")
32 return 5;
33 if (Test2.Two.ToString () != "2")
34 return 6;
35 return 0;
38 static void Bar ()
40 Console.WriteLine (Foo.foo);
44 [StructLayout(LayoutKind.Explicit)]
45 public struct Test
47 public static float Zero = 0.0f;
48 [ThreadStatic]
49 public static float One = 1.0f;
50 [ContextStatic]
51 public static float Two = 2.0f;
54 public struct Test2
56 public static float Zero = 0.0f;
57 [ThreadStatic]
58 public static float One = 1.0f;
59 [ContextStatic]
60 public static float Two = 2.0f;