Update mcs/class/System.Core/System/TimeZoneInfo.cs
[mono.git] / mcs / tests / test-406.cs
1 // Compiler options: -unsafe
2
3 //
4 // This tests excercises the compound assignment when the left side
5 // is an dereference operator.
6 //
7 using System;
8 namespace TestCase {
9         public unsafe class Test {
10                 static int Main(string[] args) {
11                         uint[] uArr = {0, 200};
12                         uint[] uArr2 = {0, 200};
13
14                         fixed (uint* u = uArr, u2 = uArr2) {
15                                 if (DoOp (u) != 100)
16                                         return 1;
17
18                                 if (uArr [0] != 100)
19                                         return 2;
20
21                                 if (uArr [1] != 200)
22                                         return 3;
23
24                                 if (DoOp2 (u2) != 100)
25                                         return 4;
26
27                                 if (uArr2 [0] != 100)
28                                         return 5;
29
30                                 if (uArr2 [1] != 200)
31                                         return 6;
32                         }
33
34                         return 0;
35                 }
36
37                 private static uint DoOp (uint *u) {
38                         return *(u) += 100;
39                 }
40
41                 private static uint DoOp2 (uint *u) {
42                         *(u) += 100;
43                         return *u;
44                 }
45
46         }
47 }
48