diff options
author | Ankit Jain <radical@corewars.org> | 2006-05-11 17:45:29 +0400 |
---|---|---|
committer | Ankit Jain <radical@corewars.org> | 2006-05-11 17:45:29 +0400 |
commit | 5619a759511a8da2fc3271eb6b502b392b39f2f6 (patch) | |
tree | 733cd830ffbee023440dcf9ab7ab3516217b081b /mcs/ilasm | |
parent | ae68491769b8ff97acb3d4d9920bdb8b5d67a22a (diff) |
In ilasm/tests:
* test-modifiers.il: New. Test for custom modifiers, modreq & modopt.
In ilasm/parser:
* ILParser.jay (type |type MODREQ ..): Use CustomModifier.modreq .
svn path=/trunk/mcs/; revision=60592
Diffstat (limited to 'mcs/ilasm')
-rw-r--r-- | mcs/ilasm/parser/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/ilasm/parser/ILParser.jay | 2 | ||||
-rw-r--r-- | mcs/ilasm/tests/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/ilasm/tests/test-modifiers.il | 69 |
4 files changed, 78 insertions, 1 deletions
diff --git a/mcs/ilasm/parser/ChangeLog b/mcs/ilasm/parser/ChangeLog index c48de45ee7c..81c42a50d95 100644 --- a/mcs/ilasm/parser/ChangeLog +++ b/mcs/ilasm/parser/ChangeLog @@ -1,3 +1,7 @@ +2006-05-11 Ankit Jain <jankit@novell.com> + + * ILParser.jay (type |type MODREQ ..): Use CustomModifier.modreq . + 2006-05-10 Ankit Jain <jankit@novell.com> * ILParser.jay (native_type | K_ERROR): Use NativeType.Error for the diff --git a/mcs/ilasm/parser/ILParser.jay b/mcs/ilasm/parser/ILParser.jay index 218c272b537..c19ae452b55 100644 --- a/mcs/ilasm/parser/ILParser.jay +++ b/mcs/ilasm/parser/ILParser.jay @@ -970,7 +970,7 @@ type : generic_class_ref BaseTypeRef base_type = GetTypeRef ((BaseTypeRef) $1);
BaseClassRef class_ref = (BaseClassRef) $4;
base_type.MakeCustomModified (codegen,
- CustomModifier.modopt, class_ref);
+ CustomModifier.modreq, class_ref);
$$ = base_type;
}
| type K_MODOPT OPEN_PARENS class_ref CLOSE_PARENS
diff --git a/mcs/ilasm/tests/ChangeLog b/mcs/ilasm/tests/ChangeLog index ec43255cc5f..95d5b124e68 100644 --- a/mcs/ilasm/tests/ChangeLog +++ b/mcs/ilasm/tests/ChangeLog @@ -1,3 +1,7 @@ +2006-05-11 Ankit Jain <jankit@novell.com> + + * test-modifiers.il: New. Test for custom modifiers, modreq & modopt. + 2006-05-09 Sebastien Pouliot <sebastien@ximian.com> * test-sn-key.il: New. Added test case when /key is used but the IL diff --git a/mcs/ilasm/tests/test-modifiers.il b/mcs/ilasm/tests/test-modifiers.il new file mode 100644 index 00000000000..67cfb62c033 --- /dev/null +++ b/mcs/ilasm/tests/test-modifiers.il @@ -0,0 +1,69 @@ +// Test for modifiers : modreq & modopt + +.assembly extern mscorlib +{ + .ver 2:0:0:0 + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. +} +.assembly 'mod' +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( + 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + + .custom instance void class [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute ::.ctor(int32 ) = (01 00 08 00 00 00 00 00 ) + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module mod.dll + + // Test for modreq + .class private auto ansi beforefieldinit test + extends [mscorlib]System.Object + { + .field private int32 modreq ([mscorlib]System.Runtime.CompilerServices.IsVolatile) f + + .method public hidebysig + instance default int32 modreq ([mscorlib]System.Runtime.CompilerServices.IsVolatile) + foo (string modreq ([mscorlib]System.Runtime.CompilerServices.IsVolatile) s, int32 b) cil managed + { + .maxstack 1 + .locals init ( + class test modreq ([mscorlib]System.Runtime.CompilerServices.IsVolatile) V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldc.i4.0 + IL_0002: stloc.1 + IL_0003: br.s IL_0005 + + IL_0005: ldloc.1 + IL_0006: ret + } + + } + + // Test for modopt + .class private auto ansi beforefieldinit test2 + extends [mscorlib]System.Object + { + .field private int32 modopt ([mscorlib]System.Runtime.CompilerServices.IsVolatile) f + + .method public hidebysig + instance default int32 modopt ([mscorlib]System.Runtime.CompilerServices.IsVolatile) + foo (string modopt ([mscorlib]System.Runtime.CompilerServices.IsVolatile) s, int32 b) cil managed + { + .maxstack 1 + .locals init ( + class test modopt ([mscorlib]System.Runtime.CompilerServices.IsVolatile) V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldc.i4.0 + IL_0002: stloc.1 + IL_0003: br.s IL_0005 + + IL_0005: ldloc.1 + IL_0006: ret + } + + } |