mirror of
https://github.com/open-goal/jak-project
synced 2026-07-31 08:16:02 -04:00
[Decompiler] Implement IR2 Type Analysis Pass (#193)
* type analysis setup * more framework * update printing * wip * add type analysis pass * fix tests
This commit is contained in:
@@ -418,7 +418,8 @@ TEST(DecompilerAtomicOpBuilder, DSUBU_DADDIU_MOVZ) {
|
||||
|
||||
TEST(DecompilerAtomicOpBuilder, JALR_SLL) {
|
||||
test_case(assembly_from_list({"jalr ra, t9", "sll v0, ra, 0"}), {"(call!)"}, {{}}, {{"t9"}},
|
||||
{{}});
|
||||
{{"a0", "a1", "a2", "a3", "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9",
|
||||
"at", "v1"}});
|
||||
}
|
||||
|
||||
TEST(DecompilerAtomicOpBuilder, LB) {
|
||||
|
||||
@@ -196,6 +196,12 @@ TEST(TypeSystem, AddMethodAndLookupMethod) {
|
||||
EXPECT_EQ(ts.lookup_method("basic", "test-method-1").defined_in_type, "structure");
|
||||
EXPECT_EQ(ts.lookup_method("basic", "test-method-1").type.print(), "(function integer string)");
|
||||
EXPECT_EQ(ts.lookup_method("basic", "test-method-1").name, "test-method-1");
|
||||
|
||||
auto id = ts.lookup_method("basic", "test-method-1").id;
|
||||
MethodInfo info;
|
||||
EXPECT_TRUE(ts.try_lookup_method("basic", id, &info));
|
||||
EXPECT_FALSE(ts.try_lookup_method("not-a-real-type-name", id, &info));
|
||||
EXPECT_FALSE(ts.try_lookup_method("basic", id * 2, &info));
|
||||
}
|
||||
|
||||
TEST(TypeSystem, NewMethod) {
|
||||
|
||||
Reference in New Issue
Block a user