Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2010-10-08 20:20:23 +0400
committerMarek Safar <marek.safar@gmail.com>2010-10-08 20:26:34 +0400
commit0fe5c11b953b523409aef24bef5dfac9ac9228af (patch)
tree610667df2996b13424e658c11b05933f28591632 /mcs/tests/test-539.cs
parent6e5cb792ae275b8f93c3a03f5f75fd7572eab406 (diff)
[642975] Fix initializer of partially static multidimensional arrays
Diffstat (limited to 'mcs/tests/test-539.cs')
-rw-r--r--mcs/tests/test-539.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/mcs/tests/test-539.cs b/mcs/tests/test-539.cs
new file mode 100644
index 00000000000..2b93801f62e
--- /dev/null
+++ b/mcs/tests/test-539.cs
@@ -0,0 +1,24 @@
+// Compiler options: -optimize
+using System;
+
+class Test
+{
+ static int Main ()
+ {
+ //switching to a constant fixes the problem
+ double thisIsCausingTheProblem = 5.0;
+
+ double[,] m1 = new double[4, 4] {
+ { 1.0, 0.0, 0.0, thisIsCausingTheProblem },
+ { 0.0, 1.0, 0.0, thisIsCausingTheProblem },
+ { 0.0, 0.0, 1.0, thisIsCausingTheProblem },
+ { 0.0, 0.0, 0.0, 1.0 }
+ };
+
+ var r = m1[0, 3];
+ if (r != 5)
+ return 1;
+
+ return 0;
+ }
+}