* test-byref.il: New. Test for a call with byref return type.
authorAnkit Jain <radical@corewars.org>
Tue, 23 Aug 2005 14:13:25 +0000 (14:13 -0000)
committerAnkit Jain <radical@corewars.org>
Tue, 23 Aug 2005 14:13:25 +0000 (14:13 -0000)
svn path=/trunk/mcs/; revision=48727

mcs/ilasm/tests/ChangeLog
mcs/ilasm/tests/test-byref.il [new file with mode: 0644]

index f98d2dadc11a2a46cdd00e236c4cf6565acbbb35..83cb14ff9ec3a4c8dd34e0945163de2b1e729e07 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-23  Ankit Jain  <jankit@novell.com>
+
+       * test-byref.il: New. Test for a call with byref return type.
+
 2005-08-18  Ankit Jain  <jankit@novell.com>
 
        * test-sec-suppress.il: New. Test for SuppressUnmanagedCodeSecurity 
diff --git a/mcs/ilasm/tests/test-byref.il b/mcs/ilasm/tests/test-byref.il
new file mode 100644 (file)
index 0000000..838a7b2
--- /dev/null
@@ -0,0 +1,39 @@
+//Test for call to a method returning a byref
+.assembly extern mscorlib
+{
+}
+.assembly 'test-byref'
+{
+}
+
+  .class public auto ansi beforefieldinit Test
+       extends [mscorlib]System.Object
+  {
+    .field  private   float64[,] _data
+
+    .method public hidebysig  specialname  rtspecialname 
+           instance default void .ctor ()  cil managed 
+    {
+       .maxstack 8
+       IL_0000:  ldarg.0 
+       IL_0001:  call instance void object::.ctor()
+       IL_0006:  ret 
+    }
+
+    .method public hidebysig 
+           instance default void multByTwo ()  cil managed 
+    {
+       .maxstack 8
+       IL_0000:  ldarg.0 
+       IL_0001:  ldfld  float64[,] Test::_data
+       IL_0006:  ldc.i4.0 
+       IL_0007:  ldc.i4.0 
+       IL_0008:  call instance float64&  float64[,]::Address(int32, int32)
+       IL_000d:  dup 
+       IL_000e:  ldind.r8 
+       IL_000f:  ldc.r8 4
+       IL_0018:  mul 
+       IL_0019:  stind.r8 
+       IL_001a:  ret 
+    }
+  }