* MonthCalendar.cs:
[mono-project.git] / mcs / btests / ShiftOperators.vb
blobab7e8ca09f713c4a65e0c7acc84fb33980478a15
1 Imports System
3 Module M
4 Sub main()
5 Console.WriteLine(f())
6 End Sub
8 Function f()
9 Dim arr(15) As Boolean
11 ' Left shift operator tests
13 Dim a1 As Byte = 5
15 a1 = a1 << 1001
16 If a1 = 10 Then arr(0) = True
18 a1 = Byte.MaxValue
19 a1 = a1 << 2001
20 If a1 = 254 Then arr(1) = True
22 a1 = Byte.MinValue
23 a1 = a1 << 2002
24 If a1 = 0 Then arr(2) = True
26 Dim b1 As Integer = 5
27 Dim b2 As Integer = -5
29 b1 = b1 << 1001
30 If b1 = 2560 Then arr(3) = True
32 b1 = -5
33 b1 = b1 << 1001
34 If b1 = -2560 Then arr(4) = True
36 b1 = Integer.MaxValue
37 b1 = b1 << 1001
38 If b1 = -512 Then arr(5) = True
40 b1 = Integer.MinValue
41 b1 = b1 << 1001
42 If b1 = 0 Then arr(6) = True
44 b1 = 0
45 b1 = b1 << 1001
46 If b1 = 0 Then arr(7) = True
48 ' Right shift operator tests
50 Dim c1 As Byte = 5
52 c1 = c1 >> 1001
53 If c1 = 2 Then arr(8) = True
55 c1 = Byte.MaxValue
56 c1 = c1 >> 2001
57 If c1 = 127 Then arr(9) = True
59 c1 = Byte.MinValue
60 c1 = c1 >> 2002
61 If c1 = 0 Then arr(10) = True
63 Dim d1 As Integer = 5
65 d1 = d1 >> 1001
66 If d1 = 0 Then arr(11) = True
68 d1 = -5
69 d1 = d1 >> 1001
70 If d1 = -1 Then arr(12) = True
72 d1 = Integer.MaxValue
73 d1 = d1 >> 1001
74 If d1 = 4194303 Then arr(13) = True
76 d1 = Integer.MinValue
77 d1 = d1 >> 1001
78 If d1 = -4194304 Then arr(14) = True
80 d1 = 0
81 d1 = d1 >> 1001
82 If d1 = 0 Then arr(15) = True
84 'For i As Integer = 0 To arr.GetUpperBound(0)
85 ' Console.WriteLine("{0}: {1}", i, arr(i))
86 'Next
88 For Each bval As Boolean In arr
89 If Not bval Then
90 Return 1
91 End If
92 Next
94 Return 0
96 End Function
97 End Module