Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / sgen-gshared-vtype.cs
1 using System;
2
3 struct Foo<T> {
4         public T t;
5         public Foo (T t) { this.t = t; }
6 }
7
8 /*This is a WB-stress based test */
9
10 public class Driver<T> {
11         public static void Fill (int cycles, Func<int, T> mk_entry) {
12                 const int array_len = 9975;
13                 Foo<T>[] root = new Foo<T> [array_len];
14                 for (int i = 0; i < cycles; ++i) {
15                         for (int j = 0; j < array_len; ++j)
16                                 root [j] = new Foo<T> (mk_entry (j));
17                 }
18
19                 for (int i = 0; i < array_len; ++i)
20                         if (root [i].Equals (mk_entry (i)))
21                                 throw new Exception ("Invalid value at position " + i);
22         }       
23 }
24
25 class Driver {
26
27         static void Main () {
28                 int loops = 40;
29                 int cycles = 40;
30                 for (int i = 0; i < loops; ++i) {
31                         Driver<object>.Fill (cycles, (k) => k);
32                 }
33         }
34 }
35