update readme (#21797)
[mono-project.git] / mcs / tests / test-binaryliteral.cs
blob3d9cc89bcbd43d8a7447f2ddf58e496e9e66278e
2 class Demo {
3 static int Main ()
5 if (0b1 != 1)
6 return 1;
7 var hex1 = 0x123ul;
8 var bin1 = 0b100100011ul;
9 var bin11 = 0b100100011lu;
10 if (hex1 != bin1)
11 return 2;
12 if (hex1 != bin11)
13 return 3;
14 if (hex1.GetType () != bin1.GetType ())
15 return 4;
16 if (hex1.GetType () != bin11.GetType ())
17 return 5;
19 var hex2 = 0x7FFFFFFF;
20 var bin2 = 0b1111111111111111111111111111111;
22 if (hex2 != bin2)
23 return 6;
24 if (hex2.GetType () != bin2.GetType ())
25 return 7;
27 var hex3 = 0xFFFFFFFF;
28 var bin3 = 0b11111111111111111111111111111111;
29 if (hex3 != bin3)
30 return 8;
31 if (hex3.GetType () != bin3.GetType ())
32 return 9;
34 var hex4 = 0xFFFFFFFFu;
35 var bin4 = 0b11111111111111111111111111111111u;
36 if (hex4 != bin4)
37 return 10;
38 if (hex4.GetType () != bin4.GetType ())
39 return 11;
41 var hex5 = 0x7FFFFFFFFFFFFFFF;
42 var bin5 = 0b111111111111111111111111111111111111111111111111111111111111111;
43 if (hex5 != bin5)
44 return 12;
45 if (hex5.GetType () != bin5.GetType ())
46 return 13;
48 var hex6 = 0xFFFFFFFFFFFFFFFF;
49 var bin6 = 0b1111111111111111111111111111111111111111111111111111111111111111;
50 if (hex6 != bin6)
51 return 14;
52 if (hex6.GetType () != bin6.GetType ())
53 return 15;
55 return 0;