--- /dev/null
+//
+// AssemblyRunner.cs
+//
+// Author:
+// Rodrigo Kumpera (rkumpera@novell.com)
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.IO;
+using System.Reflection;
+
+
+namespace Verifier {
+ public class BatchCompiler : MarshalByRefObject {
+ static BatchCompiler NewBatchCompiler () {
+ AppDomain domain = AppDomain.CreateDomain ("test");
+ BatchCompiler compiler = (BatchCompiler) domain.CreateInstanceAndUnwrap(
+ Assembly.GetExecutingAssembly().FullName,
+ "Verifier.BatchCompiler");
+ return compiler;
+ }
+
+ public static void Main (String[] args) {
+ int total = 0;
+ BatchCompiler bc = NewBatchCompiler ();
+
+ foreach (string src in Directory.GetFiles (".", "*.il")) {
+ if (!bc.Compile (src))
+ bc = NewBatchCompiler ();
+ else
+ ++total;
+ }
+ Console.WriteLine ("Total compiled successfully {0}", total);
+ }
+
+ public bool Compile (String src) {
+ try {
+ Mono.ILASM.Driver.Main (new string[] { src });
+ string binary = src.Substring (0, src.Length - 3) + ".exe";
+ return File.Exists (binary);
+ } catch (Exception e) {
+ Console.WriteLine ("Error compiling {0}", e);
+ return false;
+ }
+ }
+ }
+}
+
+2008-05-01 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * unverifiable_ldsfld_no_fld.il: Fixed compilation
+ and renamed to invalid_ldsfld_no_fld.il.
+
+ * BatchCompiler.cs: New driver to fast compile the
+ verifier test suite. It's about 20x faster now.
+
+ * Makefile: Use the ilasm driver for faster compilation.
+
2008-04-30 Rodrigo Kumpera <rkumpera@novell.com>
* make_il_overflow_test.sh: New test generator
%.exe: %.cil
- ilasm -out:$@ $<
+ ilasm2 -out:$@ $<
-compile-stamp: generate-stamp
- for i in *.il; do ilasm2 $$i; done
- for i in *.cs; do gmcs /unsafe $$i; done
+BatchCompiler.exe: BatchCompiler.cs
+ gmcs -r:../../../../mcs/class/lib/net_2_0/ilasm.exe BatchCompiler.cs
+
+compile-stamp: generate-stamp BatchCompiler.exe
+ for i in *.cs; do \
+ EXE="`echo $$i | cut -d. -f1`.exe"; \
+ if ! [ -f $$EXE ]; then \
+ gmcs /unsafe $$i; \
+ fi \
+ done
+ MONO_PATH=../../../../mcs/class/lib/net_2_0/ mono BatchCompiler.exe
touch compile-stamp
clean:
test: compile-stamp run-test
-run-test:
+run-test: compile-stamp
@for i in *.exe; do \
TEST=`echo $$i | cut -d '.' -f 1`; \
RES=99; \
then \
RES=3; \
fi; \
- if [ "$$FIRST" == "unverifiable" ]; \
+ if [ "$$FIRST" == "unverifiable" ] || [ "$FIRST" == "typeunverifiable" ]; \
then \
RES=2; \
fi; \
if [ $$R2 != 0 ]; then \
echo "$$TEST is type unverifiable but did not pass under non-strict check, got $${R2} but expected 0"; \
fi \
- else \
+ elif [ $RES != 99 ]; then \
../../metadata/pedump --verify error,warn,cls,code $$TEST.exe >/dev/null 2>/dev/null; \
R=$$?; \
if [ $$R != $$RES ]; then \
--- /dev/null
+// Invalid CIL which breaks the ECMA-335,III,4.14 rules.
+// This CIL should fail verification by a conforming CLI verifier.
+
+.assembly 'test_generated'
+{
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+
+
+.class public auto ansi beforefieldinit c
+ extends [mscorlib]System.Object
+{
+}
+
+.method public static int32 Main() cil managed
+{
+ .entrypoint
+ .maxstack 2
+ .locals init (
+ class c V_0
+ )
+ ldloc.0
+ ldsfld int32 c::invalid // Invalid, no field invalid in class c.
+ pop
+ ldc.i4.0
+ ret
+}
+
+++ /dev/null
-// Invalid CIL which breaks the ECMA-335,III,4.14 rules.
-// This CIL should fail verification by a conforming CLI verifier.
-
-.assembly 'test_generated'
-{
- .hash algorithm 0x00008004
- .ver 0:0:0:0
-}
-
-
-.class public auto ansi beforefieldinit c
- extends [mscorlib]System.Object
-{
-}
-
-.method public static int32 Main() cil managed
-{
- .entrypoint
- .maxstack 2
- .locals init (
- class c V_0
- )
- ldloc.0
- ldsfld int32 c::invalid // Invalid, no field invalid in class c.
- pop
- ldc.i4.0
- ret
-}
-// Invalid CIL which breaks the ECMA-335,III,4.14 rules.
-// This CIL should fail verification by a conforming CLI verifier.
-
-.assembly 'test_generated'
-{
- .hash algorithm 0x00008004
- .ver 0:0:0:0
-}
-
-
-.class public auto ansi beforefieldinit c
- extends [mscorlib]System.Object
-{
-}
-
-.method public static int32 Main() cil managed
-{
- .entrypoint
- .maxstack 2
- .locals init (
- class c V_0
- )
- ldloc.0
- ldsfld int32 c::invalid // Invalid, no field invalid in class c.
- pop
- ldc.i4.0
- ret
-}