2010-04-06 Jb Evain <jbevain@novell.com>
[mcs.git] / ilasm / tests / test-data-c.il
blob8fd47cd7492ca64a391c0fc8d3c963bf29f67207
1 //
2 // Test emitting data and the field mapping with the data
3 // defined in another class. (Actually all .data is global,
4 // even if it is defined in a class)
5 //
6 // Author(s):
7 //  Jackson Harper (Jackson@LatitudeGeo.com)
8 //
9 // (C) 2003 Jackson Harper, All rights reserved
12 .assembly extern mscorlib { }
13 .assembly 'test-data-b' { }
15 .class public Stub extends [mscorlib]System.Object {
16        .data some_data = int32 (1)
19 .class public T extends [mscorlib]System.Object {
21         .field private static int32 some_field at some_data
23         .method public static int32 main ()
24         {
25                 .entrypoint
27                 ldsfld int32 T::some_field
28                 brfalse fail
30         pass:
31                 ldstr "PASS"
32                 call void [mscorlib]System.Console::WriteLine (string)
33                 ldc.i4.0
34                 ret
35         fail:
36                 ldstr "FAIL"
37                 call void [mscorlib]System.Console::WriteLine (string)
38                 ldc.i4.1
39                 ret
40         }