Keep order of parsed members (required by MD) to be more compatible with csc
[mono.git] / mcs / tests / gen-cast-test.cs
old mode 100755 (executable)
new mode 100644 (file)
index f0d4052..d1f9531
@@ -2,6 +2,8 @@ using System;
 
 class Stress {
 
+       static string mode = "unchecked";
+       
        static string [] types = {
                "int",   "uint",
                "short", "ushort",
@@ -38,7 +40,7 @@ class Stress {
 
        static void call (string type, string name)
        {
-               w ("\t\treceive_" + type + " (unchecked ((" + type + ") " + name + "));\n");
+               w ("\t\treceive_" + type + " (" + mode + "((" + type + ") " + name + "));\n");
        }
        
        static void generate_emision ()
@@ -72,8 +74,19 @@ class Stress {
                wl ("\t}");
        }
        
-       static void Main ()
+       static void Main (string [] args)
        {
+               foreach (string arg in args){
+                       if (arg == "-h" || arg == "--help"){
+                               Console.WriteLine ("-h, --help     Shows help");
+                               Console.WriteLine ("-c, --checked  Generate checked contexts");
+                               return;
+                       }
+                       if (arg == "--checked" || arg == "-c"){
+                               mode = "checked";
+                               continue;
+                       }
+               }
                wl ("using System;\nclass Test {\n");
 
                generate_receptors ();