3 using System.Threading;
6 public void Print() { Console.WriteLine("A"); }
10 public void Print() { Console.WriteLine("B"); }
14 public Int32 Inc2(Int32 a) { return Inc1(a); }
15 public Int32 Inc1(Int32 a) { return a + 2; }
16 public void PrintA(A a) { a.Print(); ((B)a).Print(); }
18 Console.WriteLine("Running thread" );
21 for(int i = 0; i < 1000000; i++) {
23 if(i % 100000 == 0) PrintA(b);
25 Console.WriteLine("Ending thread");
30 class Extensions { public static string BogusProperty { get; set; } }
32 class RuntimeServices {
33 public System.Reflection.MemberInfo[] members = typeof(Extensions).GetMembers();
35 foreach (var m in members) System.Console.WriteLine(m);
45 static int test_0_vector4i_cmp_gt () {
46 Vector4i a = new Vector4i (10, 5, 12, -1);
47 Vector4i b = new Vector4i (-1, 5, 10, 10);
49 Vector4i c = a.CompareGreaterThan (b);
62 static myvt CompareGT(myvt a, myvt b) {
64 r.X = a.X > b.X ? -1 : 0;
65 r.Y = a.Y > b.Y ? -1 : 0;
69 static int test_0_struct2i_cmp_gt() {
76 myvt c = CompareGT(a, b);
84 static int vararg_sum(params int[] args) {
86 foreach(int arg in args) {
91 static int test_21_vararg_test() {
95 sum += vararg_sum(2, 3);
96 sum += vararg_sum(4, 5, 6);
100 static int test_0_threads() {
101 // Run a bunch of threads, make them JIT some code and
103 ThreadRunner runner = new ThreadRunner();
104 Thread[] threads = new Thread[10];
105 for (int i = 0; i < 10; i++) {
106 threads[i] = new Thread(new ThreadStart(runner.Run));
109 for (int i = 0; i < 10; i++) {
116 static int test_0_reflection() {
117 RuntimeServices r = new RuntimeServices();
122 public class BaseClass {
125 public class LongClass : BaseClass {
127 public LongClass(long val) { Value = val; }
130 static public long add_two_LongClass(BaseClass l1, BaseClass l2) {
131 long l = checked (((LongClass)l1).Value + ((LongClass)l2).Value);
135 static int test_0_laddcc() {
136 long l = add_two_LongClass(new LongClass(System.Int64.MinValue), new LongClass(1234));
142 public static int Main(String[] args) {
143 return TestDriver.RunTests(typeof(Tests));