+
+ public static int test_12_checked_i1_cast () {
+ long l = 12;
+
+ checked {
+ return (sbyte)l;
+ }
+ }
+
+ public static int test_127_checked_i1_cast_un () {
+ ulong l = 127;
+
+ checked {
+ return (sbyte)l;
+ }
+ }
+
+ public static int test_1234_checked_i2_cast () {
+ long l = 1234;
+
+ checked {
+ return (short)l;
+ }
+ }
+
+ public static int test_32767_checked_i2_cast_un () {
+ ulong l = 32767;
+
+ checked {
+ return (ushort)l;
+ }
+ }
+
+ public static int test_1234_checked_i4_cast () {
+ ulong ul = 1234;
+
+ checked {
+ return (int)ul;
+ }
+ }
+
+ public static int test_10_int_uint_compare () {
+ uint size = 10;
+ int j = 0;
+ for (int i = 0; i < size; ++i) {
+ j++;
+ }
+ return j;
+ }
+
+ public static int test_0_ftol_clobber () {
+ long m;
+ doit (1.3, out m);
+ if (m != 1)
+ return 2;
+ return 0;
+ }
+
+ public static int test_0_ulong_regress () {
+ ulong u = 4257145737;
+ u --;
+ return (u == 4257145736) ? 0 : 1;
+ }
+
+ public static int test_0_assemble_long ()
+ {
+ uint a = 5;
+ ulong x = 0x12345678;
+ ulong y = 1;
+
+
+ ulong z = ((x - y) << 32) | a;
+
+ if (z != 0x1234567700000005)
+ return 1;
+
+ return 0;
+ }
+
+ public static int test_0_hash ()
+ {
+ ulong x = 0x1234567887654321;
+ int h = (int)(x & 0xffffffff) ^ (int)(x >> 32);
+ if (h != unchecked ((int)(0x87654321 ^ 0x12345678)))
+ return h;
+ return 0;
+
+ }
+
+ public static int test_0_shift_regress () {
+ long a = 0;
+ int b = 6;
+ UInt16 c = 3;
+
+ return ((a >> (b - c)) == 0) ? 0 : 1;
+ }
+
+ public static int test_1234_conv_ovf_u8 () {
+ int i = 1234;
+
+ checked {
+ ulong l = (ulong)i;
+ return (int)l;
+ }
+ }