Fix LLVM linker flags for 6.0.
[mono-project.git] / mcs / tests / dtest-033.cs
blobc01a0fae71b21f738ea359eb178e8072826c8707
1 using System;
3 public class Test
5 byte Prop {
6 get { return 4; }
7 set { }
10 byte this [int arg] {
11 get { return 2; }
12 set { }
15 byte Byte = 200;
16 static dynamic V;
17 dynamic DynamicByte;
18 byte[] ByteArray = { 1, 100 };
20 public static int Main ()
22 dynamic v = 'a';
23 dynamic a = new Test ();
25 string s = "-sdfas";
27 // dynamic compound assignment with different result type
28 v += s;
30 if (v != "a-sdfas")
31 return 1;
33 dynamic d2 = null;
34 d2 += "a";
35 if (d2 != "a")
36 return 2;
38 byte b = 4;
39 a.Prop *= b;
40 a[4] ^= b;
42 dynamic d = 1;
44 b = byte.MaxValue;
45 try {
46 checked {
47 b += d;
48 return 3;
50 } catch (OverflowException) {
53 b += d;
55 try {
56 checked {
57 a.Byte += 100;
58 return 4;
60 } catch (OverflowException) {
63 a.Byte += 100;
65 checked {
66 d = byte.MaxValue;
67 d += 100;
70 checked {
71 V = byte.MaxValue;
72 V -= 300;
75 var t = new Test ();
76 t.DynamicByte = byte.MaxValue;
77 d = t;
78 checked {
79 d.DynamicByte -= 500;
82 if (t.DynamicByte != -245)
83 return 5;
85 try {
86 checked {
87 d.ByteArray[1] += 200;
88 return 6;
90 } catch (OverflowException) {
93 return 0;