X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Ftests%2Ftest-44.cs;h=c1b896a58140acb7237d927dea3fdac7b51f89e4;hb=7fc65bda2c8f0fd510d1550cf78dc5947902e5de;hp=de1abf5b0993b74195cdf9285da16a4acf757cde;hpb=1970d5d6f75d27a0425e65eff55b2f13f09286b8;p=mono.git diff --git a/mcs/tests/test-44.cs b/mcs/tests/test-44.cs old mode 100755 new mode 100644 index de1abf5b099..c1b896a5814 --- a/mcs/tests/test-44.cs +++ b/mcs/tests/test-44.cs @@ -16,6 +16,20 @@ class X { return total; } + + // + // This tests typecasting from an object to an array of ints + // and then doing foreach + // + static int count (object o) + { + int total = 0; + + foreach (int i in (int []) o) + total += i; + + return total; + } static int Main () { @@ -28,6 +42,13 @@ class X { if (dob (b) != 4950) return 1; + int [] a = new int [10]; + for (int i = 0; i < 10; i++) + a [i] = 2; + + if (count (a) != 20) + return 2; + return 0; } }