Align libgc vcxproj with makefile.
[mono.git] / mono / tests / initblkTest.il
1 //tests initblk by allocating and initializing and checking an initialized area
2 //Prints PASS or FAIL
3 .assembly extern mscorlib{}
4 .assembly someTest{}
5 .module someTest
6
7 .class private auto ansi someTest
8        extends [mscorlib]System.Object {
9
10   .method public static void  go() cil managed {
11     .entrypoint
12
13         .locals init (native int)
14
15 //allocate memory
16 ldc.i4.s 10
17 localloc
18 stloc.0
19
20 //init memory offset 3 indirectly 
21 ldloc.0
22 ldc.i4.0
23 add             //addr
24 ldc.i4.0        //value
25 stind.i1
26
27 //initblk
28 ldloc.0         //addr
29 ldc.i4.7        //value
30 ldc.i4.s 10     //size
31 initblk
32
33 //load number from offset 3
34 ldloc.0
35 ldc.i4.3
36 add     
37 ldind.u1
38
39 //compare
40 ldc.i4.7
41 beq PASS
42
43 FAIL:   ldstr "FAIL"
44         call void [mscorlib]System.Console::WriteLine(string)
45         br END
46
47 PASS:   ldstr "PASS"
48         call void [mscorlib]System.Console::WriteLine(string)
49
50 END:    ret
51   }
52
53
54