Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
83 lines (57 sloc) 1.08 KB
public class TestJit {
public static uint test_call (uint a, uint b) {
return a+b;
}
public static int test_alu ()
{
uint a = 9, b = 6;
if ((a + b) != 15)
return 1;
if ((a - b) != 3)
return 1;
if ((a & 8) != 8)
return 1;
if ((a | 2) != 11)
return 1;
if ((a * b) != 54)
return 1;
if ((a / 4) != 2)
return 1;
if ((a % 4) != 1)
return 1;
b = 0;
if (~b != 0xffffffff)
return 1;
return 0;
}
public static int test_branch ()
{
uint a = 5, b = 5, t;
if (a == b) t = 1; else t = 0;
if (t != 1) return 1;
if (a != b) t = 0; else t = 1;
if (t != 1) return 1;
if (a >= b) t = 1; else t = 0;
if (t != 1) return 1;
if (a > b) t = 0; else t = 1;
if (t != 1) return 1;
if (a <= b) t = 1; else t = 0;
if (t != 1) return 1;
if (a < b) t = 0; else t = 1;
if (t != 1) return 1;
return 0;
}
public static int Main() {
int num = 1;
if (test_call (3, 5) != 8)
return num;
num++;
if (test_branch () != 0)
return num;
num++;
if (test_alu () != 0)
return num;
num++;
return 0;
}
}
Jump to Line
Something went wrong with that request. Please try again.