Add testcase for multiple missing IDs
[mono.git] / mono / tests / gc-oom-handling.cs
1 using System;
2 using System.Collections.Generic;
3
4 class Driver {
5         static int Main () {
6                 Console.WriteLine ("start");
7                 var l = new List<object> ();
8                 try {
9                         for (int i = 0; i < 40000; ++i) {
10                                 var foo = new byte[2000];
11                                 //Console.WriteLine ("done {0}",i);
12                                 if (foo == null)
13                                         Console.WriteLine ("WTF");
14                                 l.Add (foo);
15                         }
16                         Console.WriteLine ("done");
17                         return -1;
18                 } catch (Exception e) {
19                         l.Clear ();
20                         l = null;
21                         Console.WriteLine ("OOM done");
22                 }
23                 return 0;
24         }
25 }
26