linux-packaging-mono/mono/tests/sgen-case-23400.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

36 lines
812 B
C#

using System;
using System.Collections.Generic;
class StructArray16Test
{
struct RefAt64
{
public long p1, p2, p3, p4, p5, p6, p7, p8;
public object reference;
}
struct RefAt128
{
public long p1, p2, p3, p4, p5, p6, p7, p8;
public long q1, q2, q3, q4, q5, q6, q7, q8;
public object reference;
}
public static void Main ()
{
Random r = new Random (123);
for (int j = 0; j < 5000; ++j)
{
var list64 = new List<RefAt64>();
var list128 = new List<RefAt128>();
for (int i = 0; i < 200; i++)
{
// This allocation is just to force collections, to crash more quickly
object[] dummy = new object [r.Next(3, 100)];
list64.Add (new RefAt64() { reference = new object () });
list128.Add (new RefAt128() { reference = new object () });
}
}
}
}