"disable_omit_fp" can now be included in MONO_DEBUG
[mono-project.git] / mcs / tests / test-iter-03.cs
blob7f2e747b1fca7a73699ee8a551edc8466424c36a
1 // Compiler options: -langversion:default
3 //
4 // Use
6 using System;
7 using System.Collections;
9 class X {
10 static IEnumerable GetIt (int [] args)
12 foreach (int a in args)
13 yield return a;
16 static IEnumerable GetMulti (int [,] args)
18 foreach (int a in args)
19 yield return a;
22 public static int Main ()
24 int total = 0;
25 foreach (int i in GetIt (new int [] { 1, 2, 3})){
26 Console.WriteLine ("Got: " + i);
27 total += i;
30 if (total != 6)
31 return 1;
33 total = 0;
34 foreach (int i in GetMulti (new int [,] { { 10, 20 }, { 30, 40}})){
35 Console.WriteLine ("Got: " + i);
36 total += i;
38 if (total != 100)
39 return 2;
41 return 0;