2009-06-04 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 5 Jun 2009 01:19:49 +0000 (01:19 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 5 Jun 2009 01:19:49 +0000 (01:19 -0000)
* cli-blob-tests.md: LocalsSig tests.

* assembly-with-locals.il: File with all sort
of locals sig.

* Makefile: Add new dependency.

svn path=/trunk/mono/; revision=135495

mono/tests/metadata-verifier/Changelog
mono/tests/metadata-verifier/Makefile
mono/tests/metadata-verifier/assembly-with-locals.il [new file with mode: 0644]
mono/tests/metadata-verifier/cli-blob-tests.md

index 91086e96f52035e7ea82658eb4e4e7c07ccc887e..4dfcaad285f8c82d9cb1ca0851645cd7c512d399 100644 (file)
@@ -1,3 +1,12 @@
+2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * cli-blob-tests.md: LocalsSig tests.
+
+       * assembly-with-locals.il: File with all sort
+       of locals sig.
+
+       * Makefile: Add new dependency.
+
 2009-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * cli-blob-tests.md: PropertySig tests.
index cd3ac78373a8041dd8cc77c03dfe0c36c24d9beb..7b49b1dc1c6fea9bd0337933e3734fc0522c0402 100644 (file)
@@ -57,6 +57,7 @@ TEST_BINARIES = assembly-with-resource.exe \
        assembly-with-generics.exe \
        assembly-with-custommod.exe \
        assembly-with-signatures.exe \
+       assembly-with-locals.exe \
        simple-assembly.exe
 
 
diff --git a/mono/tests/metadata-verifier/assembly-with-locals.il b/mono/tests/metadata-verifier/assembly-with-locals.il
new file mode 100644 (file)
index 0000000..29fa906
--- /dev/null
@@ -0,0 +1,46 @@
+.assembly extern mscorlib
+{
+  .ver 2:0:0:0
+  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
+}
+.assembly 'simple_assembly'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
+.module simple_assembly.exe
+
+.class private auto ansi beforefieldinit Program extends [mscorlib]System.Object
+{
+       .method public static void M0 () cil managed
+       {
+               .locals init (int32 modreq ([mscorlib]System.Runtime.CompilerServices.IsVolatile) V_0,
+                                         int32& modreq ([mscorlib]System.Runtime.CompilerServices.IsVolatile) pinned V_1,
+                                         object pinned V_2,
+                                         int32*
+                                               modreq ([mscorlib]System.Runtime.CompilerServices.IsVolatile) pinned
+                                               modopt ([mscorlib]System.Runtime.CompilerServices.IsVolatile) V_3,
+                                         typedref V_4,
+                                         int32 V_5)
+               ret
+       } 
+       
+       .method public static void M1 () cil managed
+       {
+               .maxstack 8
+               .locals init (int32 & V_0, int32 V_1)
+               ldc.i4.1
+               ret
+       } 
+
+       .method public static void Main () cil managed 
+       {
+               .entrypoint
+               .maxstack 8
+               ret 
+       }
+
+}
+
+
index fc7c2c2197a2ba183af121c3ffd57f4f499d3ec5..7e67423273f3aa4301b886991208a9c52771d826 100644 (file)
@@ -149,5 +149,33 @@ property-sig {
        invalid offset blob.i (table-row (0x17 0) + 4) + 1 set-byte 0x18
        invalid offset blob.i (table-row (0x17 0) + 4) + 1 set-byte 0x07
        invalid offset blob.i (table-row (0x17 0) + 4) + 1 set-byte 0x00
+}
+
+locals-sig {
+       assembly assembly-with-locals.exe
+
+       #bad local sig
+       #row 0 has tons of locals
+       #row 1 is int32&, int32 
+       #row 2 is typedref
+
+       #typedref with byref
+       #row 1 is:      cconv pcount(2) byref int32      int32 
+       #row 1 goes to: cconv pcount(2) byref typedbyref int32
+       invalid offset blob.i (table-row (0x11 1)) + 4 set-byte 0x18
+
+       #byref pinned int32
+       #row 1 is:      cconv pcount(2) byref int32  int32 
+       #row 1 goes to: cconv pcount(1) byref pinned int32
+
+       invalid offset blob.i (table-row (0x11 1)) + 2 set-byte 0x01,
+                       offset blob.i (table-row (0x11 1)) + 4 set-byte 0x45
+
+       #pinned pinned int32
+       #row 1 is:      cconv pcount(2) byref  int32  int32 
+       #row 1 goes to: cconv pcount(1) pinned pinned int32
 
+       invalid offset blob.i (table-row (0x11 1)) + 2 set-byte 0x01,
+                       offset blob.i (table-row (0x11 1)) + 3 set-byte 0x45,
+                       offset blob.i (table-row (0x11 1)) + 4 set-byte 0x45
 }