[netcore] Disable a flaky test on interpreter (#18904)
[mono-project.git] / mono / tests / array-12193.cs
bloba93b52a1d1224d8969b675397cfb5820ebd58c37
1 // Test for creating multi-dimensional arrays.
2 // See https://github.com/mono/mono/issues/12193.
3 // See mono_array_new_n_icall.
4 // FIXME Coverage of the doubled parameter count, with lower_bounds.
6 using System;
8 class T
10 // These are separate functions so that they are
11 // JITed in a different context.
13 static System.Array f0 () { return new int[] {1,2}; }
14 static System.Array f1 () { return new int[,] {{2,3}}; }
15 static System.Array f2 () { return new int[,,] {{{3}}}; }
16 static System.Array f3 () { return new int[,,,] {{{{4}}}}; }
17 static System.Array f4 () { return new int[,,,,] {{{{{5}}}}}; }
18 static System.Array f5 () { return new int[,,,,,] {{{{{{6}}}}}}; }
19 static System.Array f6 () { return new int[,,,,,] {{{{{{6,7}}}}}}; }
20 static System.Array f7 () { return new int[,,,,,] {{{{{{6},{7}}}}}}; }
21 static System.Array f8 () { return new int[,,,,,] {{{{{{6},{8},{9}}}}}}; }
22 static System.Array f9 () { return new int[,,,,,] {{{{{{6},{8},{9}},{{1},{2},{3}}}}}}; }
23 static System.Array f10() { return new int[,,,,,] {{{{{{6,7,8},{9,10,11},{1,2,3},{5,6,7}}}}}}; }
24 static System.Array f11() {
25 // Should only have one or two alloca or sub rsp (locals and localalloc are not combined, alas).
26 var a = new int[,,,,,] {{{{{{6,7,8},{9,10,11},{1,2,3},{5,6,7}}}}}};
27 var b = new int[,,,,,] {{{{{{0x60,0x70,0x80},{0x90,0x100,0x110},{0x10,0x20,0x30},{0x50,0x60,0x70}}}}}};
28 var c = new int[,,,,,] {{{{{{0x600,0x700,0x800},{0x900,0x1000,0x1100},{0x100,0x200,0x300},{0x500,0x600,0x700}}}}}};
29 return a == b ? null : c;
32 static System.Array f12() {
33 // Should only have one or two alloca or sub rsp (locals and localalloc are not combined, alas).
34 // Should use more stack than f11.
35 var a = new int[,,,,,,,,,,,,,,,,,,] {{{{{{{{{{{{{{{{{{{ 1 }}}}}}}}}}}}}}}}}}};
36 var b = new int[,,,,,,,,,,,,,,,,,,] {{{{{{{{{{{{{{{{{{{ 2 }}}}}}}}}}}}}}}}}}};
37 var c = new int[,,,,,,,,,,,,,,,,,,] {{{{{{{{{{{{{{{{{{{ 3 }}}}}}}}}}}}}}}}}}};
38 a = new int[,,,,,,,,,,,,,,,,,,] {{{{{{{{{{{{{{{{{{{ 4 }}}}}}}}}}}}}}}}}}};
39 b = new int[,,,,,,,,,,,,,,,,,,] {{{{{{{{{{{{{{{{{{{ 5 }}}}}}}}}}}}}}}}}}};
40 c = new int[,,,,,,,,,,,,,,,,,,] {{{{{{{{{{{{{{{{{{{ 6 }}}}}}}}}}}}}}}}}}};
41 return a == b ? null : c;
44 static int Main ()
46 return (f0 ().Rank
47 + f1 ().Rank
48 + f2 ().Rank
49 + f3 ().Rank
50 + f4 ().Rank
51 + f5 ().Rank
52 + f6 ().Rank
53 + f7 ().Rank
54 + f8 ().Rank
55 + f9 ().Rank
56 + f10 ().Rank
57 + f11 ().Rank
58 + f12 ().Rank) == 76 ? 0 : 1;
59 // Matches desktop. FIXME: Verify more.