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

test-110.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b8900991ed390fa62ba9cd66e723fca9fc940e49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// Special test case for the Compound Assignment for the
// second case (not the obvious one, but the one with 
// implicit casts)

using System;

namespace test
{
        public class test
        {
                static int test_method(int vv)
                {
			byte b = 45;

			// The cast below will force the expression into being
			// a byte, and we basically make an explicit cast from
			// the return of "<<" from int to byte (the right-side type
			// of the compound assignemtn)
                        b |= (byte)(vv << 1);

                        return b;
                }

                public static int Main ()
                {
			if (test_method (1) != 47)
				return 1;
			return 0;
                }
        }
}