* cli-tables-tests.md: Add tests for the exported type table.
* assembly-with-module.il: Old file not longer needed.
* assembly-with-module.cs: File use to generate
tests for the exported table.
* module.il: Same. This file is written in MSIL because
gmcs/SRE can't handle the AssemblyAttributesGoHere hack.
* Makefile: Adjust the build to the new files.
svn path=/trunk/mono/; revision=134253
+2009-05-15 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * cli-tables-tests.md: Add tests for the exported type table.
+
+ * assembly-with-module.il: Old file not longer needed.
+
+ * assembly-with-module.cs: File use to generate
+ tests for the exported table.
+
+ * module.il: Same. This file is written in MSIL because
+ gmcs/SRE can't handle the AssemblyAttributesGoHere hack.
+
+ * Makefile: Adjust the build to the new files.
+
2009-05-15 Rodrigo Kumpera <rkumpera@novell.com>
* cli-tables-tests.md: Add tests for the file table.
assembly-with-properties.exe: assembly-with-properties.cs
gmcs assembly-with-properties.cs
+module.netmodule: module.il
+ ilasm2 /dll /output:module.netmodule module.il
+
+assembly-with-module.exe: assembly-with-module.cs module.netmodule
+ gmcs assembly-with-module.cs -addmodule:module.netmodule
+
TEST_BINARIES = assembly-with-resource.exe \
assembly-with-complex-type.exe \
assembly-with-methods.exe \
--- /dev/null
+using System;
+using System.Reflection.Emit;
+using System.Runtime.CompilerServices;
+
+[assembly:TypeForwardedTo(typeof(AssemblyBuilder))]
+
+class Driver {
+ public static void Main (){
+ Console.WriteLine (typeof (Module.Exported));
+ Console.WriteLine (new Module.Exported.NestedClass ());
+ }
+}
+++ /dev/null
-.assembly extern mscorlib
-{
- .ver 2:0:0:0
- .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
-}
-
-.assembly 'assembly_with_module'
-{
- .hash algorithm 0x00008004
- .ver 0:0:0:0
-}
-
-.module assembly_with_module.exe
-.module extern 'simple-assembly.exe'
-
-.method public static void Main () cil managed
-{
- .entrypoint
- .maxstack 8
- ret
-}
-
#This part of the test suite only verifies structural properties, not table relationships
- #Flags invalid bits: 9,11,14,15,19,21,24-31
+ #Flags invalid bits: 6,9,14,15,19,21,24-31
+ invalid offset table-row ( 2 1 ) set-bit 6
invalid offset table-row ( 2 1 ) set-bit 9
- invalid offset table-row ( 2 1 ) set-bit 11
invalid offset table-row ( 2 1 ) set-bit 14
invalid offset table-row ( 2 1 ) set-bit 15
invalid offset table-row ( 2 1 ) set-bit 19
#TODO check for dups based on name
#TODO check for images with rows in file and assembly tables
}
+
+exported-type-table {
+ assembly assembly-with-module.exe
+
+ #flags is valid (it's a TypeAttribute flag set) (3)
+ #Flags invalid bits: 6,9,14,15,19,21,24-31
+ invalid offset table-row (0x27 0) set-bit 6 #this is a mysterious bit on MS
+ invalid offset table-row (0x27 0) set-bit 9
+ invalid offset table-row (0x27 0) set-bit 14
+ invalid offset table-row (0x27 0) set-bit 15
+ invalid offset table-row (0x27 0) set-bit 19
+ valid offset table-row (0x27 0) set-bit 21 #this is the non specified FORWARDER bit
+ invalid offset table-row (0x27 0) set-bit 24
+ invalid offset table-row (0x27 0) set-bit 25
+ invalid offset table-row (0x27 0) set-bit 26
+ invalid offset table-row (0x27 0) set-bit 27
+ invalid offset table-row (0x27 0) set-bit 28
+ invalid offset table-row (0x27 0) set-bit 29
+ invalid offset table-row (0x27 0) set-bit 30
+ invalid offset table-row (0x27 0) set-bit 31
+
+ #type 0 is toplevel
+ #type 1 is nested
+ #if Implementation points to file table visibility must be public (4)
+ #invalid offset table-row (0x27 0) set-uint 0x100005 #LAMEIMPL/SPEC this check is not really relevant
+
+ #if Implementation points to exported type table visibility must be nested public (5)
+ #invalid offset table-row (0x27 1) set-uint 0x100005 #LAMEIMPL/SPEC this check is not really relevant
+
+ #typename is a valid non-empty string (7)
+ invalid offset table-row (0x27 0) + 8 set-ushort 0
+ invalid offset table-row (0x27 0) + 8 set-ushort 0x9900
+
+ #typenamedpace is a valid string (8,9)
+ invalid offset table-row (0x27 0) + 10 set-ushort 0x9900
+
+ #nested types must have an empty typenamespace (11)
+ valid offset table-row (0x27 1) + 10 set-ushort 0
+ invalid offset table-row (0x27 1) + 10 set-ushort 1 #LAMEIMPL ms doesn't check this.
+
+ #12 implementation is a valid non empty token (12)
+ invalid offset table-row (0x27 0) + 12 set-ushort 0
+ invalid offset table-row (0x27 0) + 12 set-ushort 0x8880
+
+ #TODO check if a type in the exported table is not defined in the current module (2)
+ #TODO check if target type is valid and public (6)
+ #TODO check for dups (14,15,16)
+}
+
--- /dev/null
+\r
+// Microsoft (R) .NET Framework IL Disassembler. Version 3.5.21022.8\r
+// Copyright (c) Microsoft Corporation. All rights reserved.\r
+\r
+\r
+\r
+// Metadata version: v2.0.50727\r
+.assembly extern mscorlib\r
+{\r
+ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..\r
+ .ver 2:0:0:0\r
+}\r
+.module module.netmodule\r
+// MVID: {6EC23D5F-E5C7-4DA2-9E39-4E18B7D0CB11}\r
+.imagebase 0x00400000\r
+.file alignment 0x00000200\r
+.stackreserve 0x00100000\r
+.subsystem 0x0003 // WINDOWS_CUI\r
+.corflags 0x00000001 // ILONLY\r
+// Image base: 0x00E90000\r
+\r
+\r
+// =============== CLASS MEMBERS DECLARATION ===================\r
+\r
+.class public auto ansi beforefieldinit Module.Exported\r
+ extends [mscorlib]System.Object\r
+{\r
+ .class auto ansi nested public beforefieldinit NestedClass\r
+ extends [mscorlib]System.Object\r
+ {\r
+ .method public hidebysig virtual instance string \r
+ ToString() cil managed\r
+ {\r
+ // Code size 11 (0xb)\r
+ .maxstack 1\r
+ .locals init (string V_0)\r
+ IL_0000: nop\r
+ IL_0001: ldstr "test"\r
+ IL_0006: stloc.0\r
+ IL_0007: br.s IL_0009\r
+\r
+ IL_0009: ldloc.0\r
+ IL_000a: ret\r
+ } // end of method NestedClass::ToString\r
+\r
+ .method public hidebysig specialname rtspecialname \r
+ instance void .ctor() cil managed\r
+ {\r
+ // Code size 7 (0x7)\r
+ .maxstack 8\r
+ IL_0000: ldarg.0\r
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()\r
+ IL_0006: ret\r
+ } // end of method NestedClass::.ctor\r
+\r
+ } // end of class NestedClass\r
+\r
+ .method public hidebysig specialname rtspecialname \r
+ instance void .ctor() cil managed\r
+ {\r
+ // Code size 7 (0x7)\r
+ .maxstack 8\r
+ IL_0000: ldarg.0\r
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()\r
+ IL_0006: ret\r
+ } // end of method Exported::.ctor\r
+\r
+} // end of class Module.Exported\r
+\r
+