long a = 0xffffffffff;
if (a == 0xfffffffffe)
return 1;
+ if (a == 0xfeffffffff)
+ return 2;
return 0;
}
long a = 0xffffffffff;
if (a > 0xffffffffff)
return 1;
+
+ if (a > 0x1ffffffffff)
+ return 2;
+
+ if (a > 0xff00000000) {} else
+ return 3;
+
+ if (a > 0xfeffffffff) {} else
+ return 4;
+
+ a = 0xff00000000;
+ if (a > 0xffffffffff)
+ return 5;
+
return 0;
}
ulong a = 0xffffffffff;
if (a > 0xffffffffff)
return 1;
+
+ if (a > 0x1ffffffffff)
+ return 2;
+
+ if (a > 0xff00000000) {} else
+ return 3;
+
+ if (a > 0xfeffffffff) {} else
+ return 4;
+
+ a = 0xff00000000;
+ if (a > 0xffffffffff)
+ return 5;
+
return 0;
}
long a = 0xffffffffff;
if (a < 0xffffffffff)
return 1;
+
+ if (a < 0x1ffffffffff) {} else
+ return 2;
+
+ if (a < 0xff00000000)
+ return 3;
+
+ if (a < 0xfeffffffff)
+ return 4;
+
+ a = 0xff00000000;
+ if (a < 0xffffffffff) {} else
+ return 5;
+
return 0;
}
ulong a = 0xffffffffff;
if (a < 0xffffffffff)
return 1;
+
+ if (a < 0x1ffffffffff) {} else
+ return 2;
+
+ if (a < 0xff00000000)
+ return 3;
+
+ if (a < 0xfeffffffff)
+ return 4;
+
+ a = 0xff00000000;
+ if (a < 0xffffffffff) {} else
+ return 5;
+
return 0;
}
long a = 0xfffffffffe;
if (a >= 0xffffffffff)
return 1;
+
+ if (a >= 0x1fffffffffe)
+ return 2;
+
+ if (a >= 0xff00000000) {} else
+ return 3;
+
+ if (a >= 0xfefffffffe) {} else
+ return 4;
+
+ a = 0xff00000000;
+ if (a >= 0xffffffffff)
+ return 5;
+
return 0;
}
ulong a = 0xfffffffffe;
if (a >= 0xffffffffff)
return 1;
+
+ if (a >= 0x1fffffffffe)
+ return 2;
+
+ if (a >= 0xff00000000) {} else
+ return 3;
+
+ if (a >= 0xfefffffffe) {} else
+ return 4;
+
+ a = 0xff00000000;
+ if (a >= 0xffffffffff)
+ return 5;
+
return 0;
}
long a = 0xffffffffff;
if (a <= 0xfffffffffe)
return 1;
+
+ if (a <= 0x1ffffffffff) {} else
+ return 2;
+
+ if (a <= 0xff00000000)
+ return 3;
+
+ if (a <= 0xfeffffffff)
+ return 4;
+
+ a = 0xff00000000;
+ if (a <= 0xffffffffff) {} else
+ return 5;
+
+ return 0;
+ }
+
+ public static int test_0_bgt_un () {
+ ulong a = 0xffffffffff;
+ if (a <= 0xfffffffffe)
+ return 1;
+
+ if (a <= 0x1ffffffffff) {} else
+ return 2;
+
+ if (a <= 0xff00000000)
+ return 3;
+
+ if (a <= 0xfeffffffff)
+ return 4;
+
+ a = 0xff00000000;
+ if (a <= 0xffffffffff) {} else
+ return 5;
+
return 0;
}
return (int)(a & 8);
}
+ public static int get_high_bit (ulong a) {
+ if ((a & 0x8000000000000000) != 0)
+ return 1;
+ return 0;
+ }
+
+ public static int test_1_and () {
+ ulong a = 0xabcd1234deadbeef;
+ return get_high_bit (a);
+ }
+
public static int test_10_or () {
long a = 8;
long b = 2;
return 0;
}
- static long return_5low () {
- return 5;
- }
-
- static long return_5high () {
- return 0x500000000;
- }
-
- public static int test_3_long_ret () {
- long val = return_5low ();
- return (int) (val - 2);
- }
-
- public static int test_1_long_ret2 () {
- long val = return_5high ();
- if (val > 0xffffffff)
- return 1;
- return 0;
- }
-
public static int test_3_byte_cast () {
ulong val = 0xff00ff00f0f0f0f0;
byte b;
return t == 0 ? 0 : 1;
}
+
+ public static int test_0_conv_u () {
+ unsafe {
+ int** dead = (int**) 0xdeadbeaf;
+ long i = (long)dead;
+ return (i == 0xdeadbeaf) ? 0 : 1;
+ }
+ }
+
+ public static int test_0_lconv_to_u2 () {
+ unchecked {
+ ulong value = (ulong)(short)-10;
+ value = (ushort)value;
+ return (value == 65526) ? 0 : 1;
+ }
+ }
}