return b - 1;
}
+ static int test_2_sub_large_imm () {
+ int b = 0xff0f0f;
+ return b - 0xff0f0d;
+ }
+
static int test_0_sub_inv_imm () {
int b = 2;
return 2 - b;
return b & 0x10000000;
}
+ static int test_0_and_large_imm2 () {
+ int b = 2;
+ return b & 0x100000f0;
+ }
+
static int test_2_div () {
int b = 6;
int a = 3;
return b / 2;
}
+ static int test_719177_div_destreg () {
+ int year = 1970;
+ return ((365* (year-1)) + ((year-1)/4));
+ }
+
static int test_1_remun_imm () {
uint b = 13;
return (int)(b % 3);
return b | 0x10000000;
}
+ static int test_268435459_or_large_imm2 () {
+ int b = 2;
+ return b | 0x10000001;
+ }
+
+ static int test_1_xor () {
+ int b = 2;
+ int a = 3;
+ return b ^ a;
+ }
+
+ static int test_1_xor_imm () {
+ int b = 2;
+ return b ^ 3;
+ }
+
+ static int test_983041_xor_imm_large () {
+ int b = 2;
+ return b ^ 0xf0003;
+ }
+
static int test_1_neg () {
int b = -2;
b++;
return b << 3;
}
+ static int test_524288_shift_imm_large () {
+ int b = 2;
+ return b << 18;
+ }
+
static int test_12_shift_imm_inv () {
int b = 2;
return 3 << 2;
}
return 2;
}
+
+ static int test_0_checked_byte_cast () {
+ int v = 250;
+ int b = checked ((byte) (v));
+
+ if (b != 250)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_checked_byte_cast_un () {
+ uint v = 250;
+ uint b = checked ((byte) (v));
+
+ if (b != 250)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_checked_short_cast () {
+ int v = 250;
+ int b = checked ((ushort) (v));
+
+ if (b != 250)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_checked_short_cast_un () {
+ uint v = 250;
+ uint b = checked ((ushort) (v));
+
+ if (b != 250)
+ return 1;
+ return 0;
+ }
+
}