New tests for pinvoke
[mono.git] / mcs / ilasm / tests / test-pinvoke-a.il
1 //
2 // Test pinvoking unmanaged code
3 //
4 // Author(s):
5 //  Jackson Harper (jackson@ximian.com)
6 //
7 // (C) 2003 Ximian Inc, (http://www.ximian.com)
8 //
9
10 .assembly extern mscorlib { }
11 .assembly 'test-pinvoke-a' { }
12
13
14 .class public T {
15
16         .method public static pinvokeimpl ("test-pinvoke" as "ret_one" cdecl)
17                 int32 RetOne () cil managed { }
18
19         .method public static int32 test ()
20         {
21                 .entrypoint
22
23                 call int32 T::RetOne ()
24                 brfalse FAIL
25
26         PASS:
27                 ldstr "PASS"
28                 call void [mscorlib]System.Console::WriteLine (string)
29                 ldc.i4.0
30                 ret
31
32         FAIL:
33                 ldstr "FAIL"
34                 call void [mscorlib]System.Console::WriteLine (string)
35                 ldc.i4.1
36                 ret
37         }
38
39 }
40