From a880dac7603b740b61f3035b56fb60d049d67911 Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Thu, 26 Feb 2026 19:30:53 -0500 Subject: [PATCH 01/12] First stab at a test suite --- tests/.gitignore | 2 + .../kmBranchDefAsm_cpp/expected/output-ar.txt | 24 ++++ .../expected/output-code.bin | Bin 0 -> 64 bytes .../expected/output-dolphin.ini | 24 ++++ .../expected/output-gecko.txt | 17 +++ .../expected/output-kamek.Base.bin | Bin 0 -> 224 bytes .../expected/output-kamek.V2.bin | Bin 0 -> 224 bytes .../expected/output-map-dynamic.map | 17 +++ .../expected/output-map-static.map | 17 +++ .../expected/output-riiv.xml | 9 ++ tests/kmBranchDefAsm_cpp/externals.txt | 5 + tests/kmBranchDefAsm_cpp/test.cpp | 18 +++ .../kmBranchDefCpp_cpp/expected/output-ar.txt | 24 ++++ .../expected/output-code.bin | Bin 0 -> 64 bytes .../expected/output-dolphin.ini | 24 ++++ .../expected/output-gecko.txt | 17 +++ .../expected/output-kamek.Base.bin | Bin 0 -> 224 bytes .../expected/output-kamek.V2.bin | Bin 0 -> 224 bytes .../expected/output-map-dynamic.map | 17 +++ .../expected/output-map-static.map | 17 +++ .../expected/output-riiv.xml | 9 ++ tests/kmBranchDefCpp_cpp/externals.txt | 5 + tests/kmBranchDefCpp_cpp/test.cpp | 18 +++ tests/kmBranchDef_asm/expected/output-ar.txt | 6 + .../kmBranchDef_asm/expected/output-code.bin | Bin 0 -> 16 bytes .../expected/output-dolphin.ini | 6 + .../kmBranchDef_asm/expected/output-gecko.txt | 5 + .../expected/output-kamek.Base.bin | Bin 0 -> 72 bytes .../expected/output-kamek.V2.bin | Bin 0 -> 72 bytes .../expected/output-map-dynamic.map | 16 +++ .../expected/output-map-static.map | 16 +++ .../kmBranchDef_asm/expected/output-riiv.xml | 3 + tests/kmBranchDef_asm/externals.txt | 1 + tests/kmBranchDef_asm/test.S | 10 ++ tests/kmBranch_asm/expected/output-ar.txt | 7 + tests/kmBranch_asm/expected/output-code.bin | Bin 0 -> 4 bytes .../kmBranch_asm/expected/output-dolphin.ini | 7 + tests/kmBranch_asm/expected/output-gecko.txt | 8 ++ .../expected/output-kamek.Base.bin | Bin 0 -> 108 bytes .../kmBranch_asm/expected/output-kamek.V2.bin | Bin 0 -> 108 bytes .../expected/output-map-dynamic.map | 16 +++ .../expected/output-map-static.map | 16 +++ tests/kmBranch_asm/expected/output-riiv.xml | 7 + tests/kmBranch_asm/externals.txt | 4 + tests/kmBranch_asm/test.S | 15 +++ tests/kmBranch_cpp/expected/output-ar.txt | 6 + tests/kmBranch_cpp/expected/output-code.bin | 0 .../kmBranch_cpp/expected/output-dolphin.ini | 6 + tests/kmBranch_cpp/expected/output-gecko.txt | 6 + .../expected/output-kamek.Base.bin | Bin 0 -> 104 bytes .../kmBranch_cpp/expected/output-kamek.V2.bin | Bin 0 -> 104 bytes .../expected/output-map-dynamic.map | 17 +++ .../expected/output-map-static.map | 17 +++ tests/kmBranch_cpp/expected/output-riiv.xml | 6 + tests/kmBranch_cpp/externals.txt | 4 + tests/kmBranch_cpp/test.cpp | 15 +++ tests/kmCallDefAsm_cpp/expected/output-ar.txt | 6 + .../kmCallDefAsm_cpp/expected/output-code.bin | Bin 0 -> 16 bytes .../expected/output-dolphin.ini | 6 + .../expected/output-gecko.txt | 5 + .../expected/output-kamek.Base.bin | Bin 0 -> 72 bytes .../expected/output-kamek.V2.bin | Bin 0 -> 72 bytes .../expected/output-map-dynamic.map | 16 +++ .../expected/output-map-static.map | 16 +++ .../kmCallDefAsm_cpp/expected/output-riiv.xml | 3 + tests/kmCallDefAsm_cpp/externals.txt | 1 + tests/kmCallDefAsm_cpp/test.cpp | 6 + tests/kmCallDefCpp_cpp/expected/output-ar.txt | 6 + .../kmCallDefCpp_cpp/expected/output-code.bin | Bin 0 -> 16 bytes .../expected/output-dolphin.ini | 6 + .../expected/output-gecko.txt | 5 + .../expected/output-kamek.Base.bin | Bin 0 -> 72 bytes .../expected/output-kamek.V2.bin | Bin 0 -> 72 bytes .../expected/output-map-dynamic.map | 16 +++ .../expected/output-map-static.map | 16 +++ .../kmCallDefCpp_cpp/expected/output-riiv.xml | 3 + tests/kmCallDefCpp_cpp/externals.txt | 1 + tests/kmCallDefCpp_cpp/test.cpp | 6 + tests/kmCallDef_asm/expected/output-ar.txt | 6 + tests/kmCallDef_asm/expected/output-code.bin | Bin 0 -> 16 bytes .../kmCallDef_asm/expected/output-dolphin.ini | 6 + tests/kmCallDef_asm/expected/output-gecko.txt | 5 + .../expected/output-kamek.Base.bin | Bin 0 -> 72 bytes .../expected/output-kamek.V2.bin | Bin 0 -> 72 bytes .../expected/output-map-dynamic.map | 16 +++ .../expected/output-map-static.map | 16 +++ tests/kmCallDef_asm/expected/output-riiv.xml | 3 + tests/kmCallDef_asm/externals.txt | 1 + tests/kmCallDef_asm/test.S | 10 ++ tests/kmCall_asm/expected/output-ar.txt | 7 + tests/kmCall_asm/expected/output-code.bin | Bin 0 -> 4 bytes tests/kmCall_asm/expected/output-dolphin.ini | 7 + tests/kmCall_asm/expected/output-gecko.txt | 8 ++ .../kmCall_asm/expected/output-kamek.Base.bin | Bin 0 -> 108 bytes tests/kmCall_asm/expected/output-kamek.V2.bin | Bin 0 -> 108 bytes .../expected/output-map-dynamic.map | 16 +++ .../kmCall_asm/expected/output-map-static.map | 16 +++ tests/kmCall_asm/expected/output-riiv.xml | 7 + tests/kmCall_asm/externals.txt | 4 + tests/kmCall_asm/test.S | 15 +++ tests/kmCall_cpp/expected/output-ar.txt | 6 + tests/kmCall_cpp/expected/output-code.bin | 0 tests/kmCall_cpp/expected/output-dolphin.ini | 6 + tests/kmCall_cpp/expected/output-gecko.txt | 6 + .../kmCall_cpp/expected/output-kamek.Base.bin | Bin 0 -> 104 bytes tests/kmCall_cpp/expected/output-kamek.V2.bin | Bin 0 -> 104 bytes .../expected/output-map-dynamic.map | 17 +++ .../kmCall_cpp/expected/output-map-static.map | 17 +++ tests/kmCall_cpp/expected/output-riiv.xml | 6 + tests/kmCall_cpp/externals.txt | 4 + tests/kmCall_cpp/test.cpp | 15 +++ tests/kmPatchExitPoint/expected/output-ar.txt | 4 + .../kmPatchExitPoint/expected/output-code.bin | Bin 0 -> 16 bytes .../expected/output-dolphin.ini | 4 + .../expected/output-gecko.txt | 3 + .../expected/output-kamek.Base.bin | Bin 0 -> 64 bytes .../expected/output-kamek.V2.bin | Bin 0 -> 64 bytes .../expected/output-map-dynamic.map | 21 +++ .../expected/output-map-static.map | 21 +++ .../kmPatchExitPoint/expected/output-riiv.xml | 1 + tests/kmPatchExitPoint/externals.txt | 1 + tests/kmPatchExitPoint/test.cpp | 14 ++ tests/run_tests.py | 124 ++++++++++++++++++ tests/versions.txt | 7 + tests/writes_asm/expected/output-ar.txt | 29 ++++ tests/writes_asm/expected/output-code.bin | Bin 0 -> 4 bytes tests/writes_asm/expected/output-dolphin.ini | 19 +++ tests/writes_asm/expected/output-gecko.txt | 44 +++++++ .../writes_asm/expected/output-kamek.Base.bin | Bin 0 -> 292 bytes tests/writes_asm/expected/output-kamek.V2.bin | Bin 0 -> 292 bytes .../expected/output-map-dynamic.map | 16 +++ .../writes_asm/expected/output-map-static.map | 16 +++ tests/writes_asm/expected/output-riiv.xml | 19 +++ tests/writes_asm/externals.txt | 1 + tests/writes_asm/test.S | 26 ++++ tests/writes_cpp/expected/output-ar.txt | 28 ++++ tests/writes_cpp/expected/output-code.bin | 0 tests/writes_cpp/expected/output-dolphin.ini | 18 +++ tests/writes_cpp/expected/output-gecko.txt | 40 ++++++ .../writes_cpp/expected/output-kamek.Base.bin | Bin 0 -> 288 bytes tests/writes_cpp/expected/output-kamek.V2.bin | Bin 0 -> 288 bytes .../expected/output-map-dynamic.map | 17 +++ .../writes_cpp/expected/output-map-static.map | 17 +++ tests/writes_cpp/expected/output-riiv.xml | 18 +++ tests/writes_cpp/externals.txt | 1 + tests/writes_cpp/test.cpp | 26 ++++ 146 files changed, 1357 insertions(+) create mode 100644 tests/.gitignore create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-ar.txt create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-code.bin create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-dolphin.ini create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-gecko.txt create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-kamek.Base.bin create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-kamek.V2.bin create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-map-dynamic.map create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-map-static.map create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-riiv.xml create mode 100644 tests/kmBranchDefAsm_cpp/externals.txt create mode 100644 tests/kmBranchDefAsm_cpp/test.cpp create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-ar.txt create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-code.bin create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-dolphin.ini create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-gecko.txt create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-kamek.Base.bin create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-kamek.V2.bin create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-map-dynamic.map create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-map-static.map create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-riiv.xml create mode 100644 tests/kmBranchDefCpp_cpp/externals.txt create mode 100644 tests/kmBranchDefCpp_cpp/test.cpp create mode 100644 tests/kmBranchDef_asm/expected/output-ar.txt create mode 100644 tests/kmBranchDef_asm/expected/output-code.bin create mode 100644 tests/kmBranchDef_asm/expected/output-dolphin.ini create mode 100644 tests/kmBranchDef_asm/expected/output-gecko.txt create mode 100644 tests/kmBranchDef_asm/expected/output-kamek.Base.bin create mode 100644 tests/kmBranchDef_asm/expected/output-kamek.V2.bin create mode 100644 tests/kmBranchDef_asm/expected/output-map-dynamic.map create mode 100644 tests/kmBranchDef_asm/expected/output-map-static.map create mode 100644 tests/kmBranchDef_asm/expected/output-riiv.xml create mode 100644 tests/kmBranchDef_asm/externals.txt create mode 100644 tests/kmBranchDef_asm/test.S create mode 100644 tests/kmBranch_asm/expected/output-ar.txt create mode 100644 tests/kmBranch_asm/expected/output-code.bin create mode 100644 tests/kmBranch_asm/expected/output-dolphin.ini create mode 100644 tests/kmBranch_asm/expected/output-gecko.txt create mode 100644 tests/kmBranch_asm/expected/output-kamek.Base.bin create mode 100644 tests/kmBranch_asm/expected/output-kamek.V2.bin create mode 100644 tests/kmBranch_asm/expected/output-map-dynamic.map create mode 100644 tests/kmBranch_asm/expected/output-map-static.map create mode 100644 tests/kmBranch_asm/expected/output-riiv.xml create mode 100644 tests/kmBranch_asm/externals.txt create mode 100644 tests/kmBranch_asm/test.S create mode 100644 tests/kmBranch_cpp/expected/output-ar.txt create mode 100644 tests/kmBranch_cpp/expected/output-code.bin create mode 100644 tests/kmBranch_cpp/expected/output-dolphin.ini create mode 100644 tests/kmBranch_cpp/expected/output-gecko.txt create mode 100644 tests/kmBranch_cpp/expected/output-kamek.Base.bin create mode 100644 tests/kmBranch_cpp/expected/output-kamek.V2.bin create mode 100644 tests/kmBranch_cpp/expected/output-map-dynamic.map create mode 100644 tests/kmBranch_cpp/expected/output-map-static.map create mode 100644 tests/kmBranch_cpp/expected/output-riiv.xml create mode 100644 tests/kmBranch_cpp/externals.txt create mode 100644 tests/kmBranch_cpp/test.cpp create mode 100644 tests/kmCallDefAsm_cpp/expected/output-ar.txt create mode 100644 tests/kmCallDefAsm_cpp/expected/output-code.bin create mode 100644 tests/kmCallDefAsm_cpp/expected/output-dolphin.ini create mode 100644 tests/kmCallDefAsm_cpp/expected/output-gecko.txt create mode 100644 tests/kmCallDefAsm_cpp/expected/output-kamek.Base.bin create mode 100644 tests/kmCallDefAsm_cpp/expected/output-kamek.V2.bin create mode 100644 tests/kmCallDefAsm_cpp/expected/output-map-dynamic.map create mode 100644 tests/kmCallDefAsm_cpp/expected/output-map-static.map create mode 100644 tests/kmCallDefAsm_cpp/expected/output-riiv.xml create mode 100644 tests/kmCallDefAsm_cpp/externals.txt create mode 100644 tests/kmCallDefAsm_cpp/test.cpp create mode 100644 tests/kmCallDefCpp_cpp/expected/output-ar.txt create mode 100644 tests/kmCallDefCpp_cpp/expected/output-code.bin create mode 100644 tests/kmCallDefCpp_cpp/expected/output-dolphin.ini create mode 100644 tests/kmCallDefCpp_cpp/expected/output-gecko.txt create mode 100644 tests/kmCallDefCpp_cpp/expected/output-kamek.Base.bin create mode 100644 tests/kmCallDefCpp_cpp/expected/output-kamek.V2.bin create mode 100644 tests/kmCallDefCpp_cpp/expected/output-map-dynamic.map create mode 100644 tests/kmCallDefCpp_cpp/expected/output-map-static.map create mode 100644 tests/kmCallDefCpp_cpp/expected/output-riiv.xml create mode 100644 tests/kmCallDefCpp_cpp/externals.txt create mode 100644 tests/kmCallDefCpp_cpp/test.cpp create mode 100644 tests/kmCallDef_asm/expected/output-ar.txt create mode 100644 tests/kmCallDef_asm/expected/output-code.bin create mode 100644 tests/kmCallDef_asm/expected/output-dolphin.ini create mode 100644 tests/kmCallDef_asm/expected/output-gecko.txt create mode 100644 tests/kmCallDef_asm/expected/output-kamek.Base.bin create mode 100644 tests/kmCallDef_asm/expected/output-kamek.V2.bin create mode 100644 tests/kmCallDef_asm/expected/output-map-dynamic.map create mode 100644 tests/kmCallDef_asm/expected/output-map-static.map create mode 100644 tests/kmCallDef_asm/expected/output-riiv.xml create mode 100644 tests/kmCallDef_asm/externals.txt create mode 100644 tests/kmCallDef_asm/test.S create mode 100644 tests/kmCall_asm/expected/output-ar.txt create mode 100644 tests/kmCall_asm/expected/output-code.bin create mode 100644 tests/kmCall_asm/expected/output-dolphin.ini create mode 100644 tests/kmCall_asm/expected/output-gecko.txt create mode 100644 tests/kmCall_asm/expected/output-kamek.Base.bin create mode 100644 tests/kmCall_asm/expected/output-kamek.V2.bin create mode 100644 tests/kmCall_asm/expected/output-map-dynamic.map create mode 100644 tests/kmCall_asm/expected/output-map-static.map create mode 100644 tests/kmCall_asm/expected/output-riiv.xml create mode 100644 tests/kmCall_asm/externals.txt create mode 100644 tests/kmCall_asm/test.S create mode 100644 tests/kmCall_cpp/expected/output-ar.txt create mode 100644 tests/kmCall_cpp/expected/output-code.bin create mode 100644 tests/kmCall_cpp/expected/output-dolphin.ini create mode 100644 tests/kmCall_cpp/expected/output-gecko.txt create mode 100644 tests/kmCall_cpp/expected/output-kamek.Base.bin create mode 100644 tests/kmCall_cpp/expected/output-kamek.V2.bin create mode 100644 tests/kmCall_cpp/expected/output-map-dynamic.map create mode 100644 tests/kmCall_cpp/expected/output-map-static.map create mode 100644 tests/kmCall_cpp/expected/output-riiv.xml create mode 100644 tests/kmCall_cpp/externals.txt create mode 100644 tests/kmCall_cpp/test.cpp create mode 100644 tests/kmPatchExitPoint/expected/output-ar.txt create mode 100644 tests/kmPatchExitPoint/expected/output-code.bin create mode 100644 tests/kmPatchExitPoint/expected/output-dolphin.ini create mode 100644 tests/kmPatchExitPoint/expected/output-gecko.txt create mode 100644 tests/kmPatchExitPoint/expected/output-kamek.Base.bin create mode 100644 tests/kmPatchExitPoint/expected/output-kamek.V2.bin create mode 100644 tests/kmPatchExitPoint/expected/output-map-dynamic.map create mode 100644 tests/kmPatchExitPoint/expected/output-map-static.map create mode 100644 tests/kmPatchExitPoint/expected/output-riiv.xml create mode 100644 tests/kmPatchExitPoint/externals.txt create mode 100644 tests/kmPatchExitPoint/test.cpp create mode 100644 tests/run_tests.py create mode 100644 tests/versions.txt create mode 100644 tests/writes_asm/expected/output-ar.txt create mode 100644 tests/writes_asm/expected/output-code.bin create mode 100644 tests/writes_asm/expected/output-dolphin.ini create mode 100644 tests/writes_asm/expected/output-gecko.txt create mode 100644 tests/writes_asm/expected/output-kamek.Base.bin create mode 100644 tests/writes_asm/expected/output-kamek.V2.bin create mode 100644 tests/writes_asm/expected/output-map-dynamic.map create mode 100644 tests/writes_asm/expected/output-map-static.map create mode 100644 tests/writes_asm/expected/output-riiv.xml create mode 100644 tests/writes_asm/externals.txt create mode 100644 tests/writes_asm/test.S create mode 100644 tests/writes_cpp/expected/output-ar.txt create mode 100644 tests/writes_cpp/expected/output-code.bin create mode 100644 tests/writes_cpp/expected/output-dolphin.ini create mode 100644 tests/writes_cpp/expected/output-gecko.txt create mode 100644 tests/writes_cpp/expected/output-kamek.Base.bin create mode 100644 tests/writes_cpp/expected/output-kamek.V2.bin create mode 100644 tests/writes_cpp/expected/output-map-dynamic.map create mode 100644 tests/writes_cpp/expected/output-map-static.map create mode 100644 tests/writes_cpp/expected/output-riiv.xml create mode 100644 tests/writes_cpp/externals.txt create mode 100644 tests/writes_cpp/test.cpp diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..ddcfdad --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,2 @@ +_bin/ +_out/ \ No newline at end of file diff --git a/tests/kmBranchDefAsm_cpp/expected/output-ar.txt b/tests/kmBranchDefAsm_cpp/expected/output-ar.txt new file mode 100644 index 0000000..a96454b --- /dev/null +++ b/tests/kmBranchDefAsm_cpp/expected/output-ar.txt @@ -0,0 +1,24 @@ +04000000 38600001 +04000004 4A000000 +04000008 38600002 +0400000C 4AFFFFF4 +04000010 38600003 +04000014 4800002C +04000018 38600004 +0400001C 4E800020 +04000020 38600005 +04000024 4A000020 +04000028 38600006 +0400002C 4AFFFFD4 +04000030 38600007 +04000034 4800000C +04000038 38600008 +0400003C 4E800020 +04000000 4A000000 +04000010 49FFFFF8 +04000020 49FFFFF0 +04000030 49FFFFE8 +05000010 49000010 +05000020 49000008 +05000030 49000000 +05000040 48FFFFF8 \ No newline at end of file diff --git a/tests/kmBranchDefAsm_cpp/expected/output-code.bin b/tests/kmBranchDefAsm_cpp/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..f94855ff06ad7c249c212529c1a6a7f121371f69 GIT binary patch literal 64 zcmcCWU|{rOU|_IFU|{n4|Nje+X7*rU&;imcehmx?K$;aO52D$C@>hT~J5ZhnNOOSX E0o~~il>h($ literal 0 HcmV?d00001 diff --git a/tests/kmBranchDefAsm_cpp/expected/output-dolphin.ini b/tests/kmBranchDefAsm_cpp/expected/output-dolphin.ini new file mode 100644 index 0000000..5ca9743 --- /dev/null +++ b/tests/kmBranchDefAsm_cpp/expected/output-dolphin.ini @@ -0,0 +1,24 @@ +0x82000000:dword:0x38600001 +0x82000004:dword:0x4A000000 +0x82000008:dword:0x38600002 +0x8200000C:dword:0x4AFFFFF4 +0x82000010:dword:0x38600003 +0x82000014:dword:0x4800002C +0x82000018:dword:0x38600004 +0x8200001C:dword:0x4E800020 +0x82000020:dword:0x38600005 +0x82000024:dword:0x4A000020 +0x82000028:dword:0x38600006 +0x8200002C:dword:0x4AFFFFD4 +0x82000030:dword:0x38600007 +0x82000034:dword:0x4800000C +0x82000038:dword:0x38600008 +0x8200003C:dword:0x4E800020 +0x80000000:dword:0x4A000000 +0x80000010:dword:0x49FFFFF8 +0x80000020:dword:0x49FFFFF0 +0x80000030:dword:0x49FFFFE8 +0x81000010:dword:0x49000010 +0x81000020:dword:0x49000008 +0x81000030:dword:0x49000000 +0x81000040:dword:0x48FFFFF8 \ No newline at end of file diff --git a/tests/kmBranchDefAsm_cpp/expected/output-gecko.txt b/tests/kmBranchDefAsm_cpp/expected/output-gecko.txt new file mode 100644 index 0000000..3689ab5 --- /dev/null +++ b/tests/kmBranchDefAsm_cpp/expected/output-gecko.txt @@ -0,0 +1,17 @@ +06000000 00000040 +38600001 4A000000 +38600002 4AFFFFF4 +38600003 4800002C +38600004 4E800020 +38600005 4A000020 +38600006 4AFFFFD4 +38600007 4800000C +38600008 4E800020 +04000000 4A000000 +04000010 49FFFFF8 +04000020 49FFFFF0 +04000030 49FFFFE8 +05000010 49000010 +05000020 49000008 +05000030 49000000 +05000040 48FFFFF8 \ No newline at end of file diff --git a/tests/kmBranchDefAsm_cpp/expected/output-kamek.Base.bin b/tests/kmBranchDefAsm_cpp/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..e7807f8050de4570dea4f5a1221d397a70b2dfa4 GIT binary patch literal 224 zcmYk0p$@`85JVsC0TqZ!!|~&kxn@WZn|V94yV=YA^>{)9 zBvt&C5XKv;YavS;YkP*1`s99X-B`EEcgnlk$2@<^a%nl9#K~SSy9>>}1@^MAHxJ@{ aW#x4?2OJ7a_A+n`{qozF)}6t*BE~OFf-znI literal 0 HcmV?d00001 diff --git a/tests/kmBranchDefAsm_cpp/expected/output-kamek.V2.bin b/tests/kmBranchDefAsm_cpp/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..2ad322ecc7a1b8781b28be99122a631395d3cf2f GIT binary patch literal 224 zcmYk0tq#IK5QIO<0Tqao$P)+zqOx)Yf`o);0D&UB!|~#jxn@WZoB7+>?B)J?JfQ=U zCjLeg#v6-kr3gFY@(f4mWW6%3jT_}#<$cpJO`kennvW;(WG~C^L%VM>_KLi0K8Wuc aSKf9@z`nxCUI7lFUw(aI>kQ5nF@6DCLNUGo literal 0 HcmV?d00001 diff --git a/tests/kmBranchDefAsm_cpp/expected/output-map-dynamic.map b/tests/kmBranchDefAsm_cpp/expected/output-map-dynamic.map new file mode 100644 index 0000000..a6a3bb6 --- /dev/null +++ b/tests/kmBranchDefAsm_cpp/expected/output-map-dynamic.map @@ -0,0 +1,17 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000040 000000 __ctor_loc + 00000040 000000 __ctor_end + 00000040 000000 _e_text + 00000040 000000 _f_ctors + 00000040 000000 _e_ctors + 00000040 000000 _f_dtors + 00000040 000000 _e_dtors + 00000040 000000 _f_rodata + 00000040 000000 _e_rodata + 00000040 000000 _f_data + 00000040 000000 _e_data + 00000040 000004 localSym diff --git a/tests/kmBranchDefAsm_cpp/expected/output-map-static.map b/tests/kmBranchDefAsm_cpp/expected/output-map-static.map new file mode 100644 index 0000000..dbf9acc --- /dev/null +++ b/tests/kmBranchDefAsm_cpp/expected/output-map-static.map @@ -0,0 +1,17 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000040 000000 __ctor_loc + 82000040 000000 __ctor_end + 82000040 000000 _e_text + 82000040 000000 _f_ctors + 82000040 000000 _e_ctors + 82000040 000000 _f_dtors + 82000040 000000 _e_dtors + 82000040 000000 _f_rodata + 82000040 000000 _e_rodata + 82000040 000000 _f_data + 82000040 000000 _e_data + 82000040 000004 localSym diff --git a/tests/kmBranchDefAsm_cpp/expected/output-riiv.xml b/tests/kmBranchDefAsm_cpp/expected/output-riiv.xml new file mode 100644 index 0000000..cefeb34 --- /dev/null +++ b/tests/kmBranchDefAsm_cpp/expected/output-riiv.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/tests/kmBranchDefAsm_cpp/externals.txt b/tests/kmBranchDefAsm_cpp/externals.txt new file mode 100644 index 0000000..37ace3f --- /dev/null +++ b/tests/kmBranchDefAsm_cpp/externals.txt @@ -0,0 +1,5 @@ +externalSym=0x81000000 +externalFunc01=0x81000010 +externalFunc02=0x81000020 +externalFunc03=0x81000030 +externalFunc04=0x81000040 \ No newline at end of file diff --git a/tests/kmBranchDefAsm_cpp/test.cpp b/tests/kmBranchDefAsm_cpp/test.cpp new file mode 100644 index 0000000..e5b1966 --- /dev/null +++ b/tests/kmBranchDefAsm_cpp/test.cpp @@ -0,0 +1,18 @@ +#include + +extern int externalSym; +int localSym; + +extern int externalFunc01; +extern int externalFunc02; +extern int externalFunc03; +extern int externalFunc04; + +kmBranchDefAsm(0x80000000, 0x80000004) { li r3, 1 } +kmBranchDefAsm(0x80000010, &externalSym) { li r3, 2 } +kmBranchDefAsm(0x80000020, &localSym) { li r3, 3 } +kmBranchDefAsm(0x80000030, 0) { li r3, 4 } +kmBranchDefAsm(&externalFunc01, 0x80000044) { li r3, 5 } +kmBranchDefAsm(&externalFunc02, &externalSym) { li r3, 6 } +kmBranchDefAsm(&externalFunc03, &localSym) { li r3, 7 } +kmBranchDefAsm(&externalFunc04, 0) { li r3, 8 } diff --git a/tests/kmBranchDefCpp_cpp/expected/output-ar.txt b/tests/kmBranchDefCpp_cpp/expected/output-ar.txt new file mode 100644 index 0000000..a96454b --- /dev/null +++ b/tests/kmBranchDefCpp_cpp/expected/output-ar.txt @@ -0,0 +1,24 @@ +04000000 38600001 +04000004 4A000000 +04000008 38600002 +0400000C 4AFFFFF4 +04000010 38600003 +04000014 4800002C +04000018 38600004 +0400001C 4E800020 +04000020 38600005 +04000024 4A000020 +04000028 38600006 +0400002C 4AFFFFD4 +04000030 38600007 +04000034 4800000C +04000038 38600008 +0400003C 4E800020 +04000000 4A000000 +04000010 49FFFFF8 +04000020 49FFFFF0 +04000030 49FFFFE8 +05000010 49000010 +05000020 49000008 +05000030 49000000 +05000040 48FFFFF8 \ No newline at end of file diff --git a/tests/kmBranchDefCpp_cpp/expected/output-code.bin b/tests/kmBranchDefCpp_cpp/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..f94855ff06ad7c249c212529c1a6a7f121371f69 GIT binary patch literal 64 zcmcCWU|{rOU|_IFU|{n4|Nje+X7*rU&;imcehmx?K$;aO52D$C@>hT~J5ZhnNOOSX E0o~~il>h($ literal 0 HcmV?d00001 diff --git a/tests/kmBranchDefCpp_cpp/expected/output-dolphin.ini b/tests/kmBranchDefCpp_cpp/expected/output-dolphin.ini new file mode 100644 index 0000000..5ca9743 --- /dev/null +++ b/tests/kmBranchDefCpp_cpp/expected/output-dolphin.ini @@ -0,0 +1,24 @@ +0x82000000:dword:0x38600001 +0x82000004:dword:0x4A000000 +0x82000008:dword:0x38600002 +0x8200000C:dword:0x4AFFFFF4 +0x82000010:dword:0x38600003 +0x82000014:dword:0x4800002C +0x82000018:dword:0x38600004 +0x8200001C:dword:0x4E800020 +0x82000020:dword:0x38600005 +0x82000024:dword:0x4A000020 +0x82000028:dword:0x38600006 +0x8200002C:dword:0x4AFFFFD4 +0x82000030:dword:0x38600007 +0x82000034:dword:0x4800000C +0x82000038:dword:0x38600008 +0x8200003C:dword:0x4E800020 +0x80000000:dword:0x4A000000 +0x80000010:dword:0x49FFFFF8 +0x80000020:dword:0x49FFFFF0 +0x80000030:dword:0x49FFFFE8 +0x81000010:dword:0x49000010 +0x81000020:dword:0x49000008 +0x81000030:dword:0x49000000 +0x81000040:dword:0x48FFFFF8 \ No newline at end of file diff --git a/tests/kmBranchDefCpp_cpp/expected/output-gecko.txt b/tests/kmBranchDefCpp_cpp/expected/output-gecko.txt new file mode 100644 index 0000000..3689ab5 --- /dev/null +++ b/tests/kmBranchDefCpp_cpp/expected/output-gecko.txt @@ -0,0 +1,17 @@ +06000000 00000040 +38600001 4A000000 +38600002 4AFFFFF4 +38600003 4800002C +38600004 4E800020 +38600005 4A000020 +38600006 4AFFFFD4 +38600007 4800000C +38600008 4E800020 +04000000 4A000000 +04000010 49FFFFF8 +04000020 49FFFFF0 +04000030 49FFFFE8 +05000010 49000010 +05000020 49000008 +05000030 49000000 +05000040 48FFFFF8 \ No newline at end of file diff --git a/tests/kmBranchDefCpp_cpp/expected/output-kamek.Base.bin b/tests/kmBranchDefCpp_cpp/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..e7807f8050de4570dea4f5a1221d397a70b2dfa4 GIT binary patch literal 224 zcmYk0p$@`85JVsC0TqZ!!|~&kxn@WZn|V94yV=YA^>{)9 zBvt&C5XKv;YavS;YkP*1`s99X-B`EEcgnlk$2@<^a%nl9#K~SSy9>>}1@^MAHxJ@{ aW#x4?2OJ7a_A+n`{qozF)}6t*BE~OFf-znI literal 0 HcmV?d00001 diff --git a/tests/kmBranchDefCpp_cpp/expected/output-kamek.V2.bin b/tests/kmBranchDefCpp_cpp/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..2ad322ecc7a1b8781b28be99122a631395d3cf2f GIT binary patch literal 224 zcmYk0tq#IK5QIO<0Tqao$P)+zqOx)Yf`o);0D&UB!|~#jxn@WZoB7+>?B)J?JfQ=U zCjLeg#v6-kr3gFY@(f4mWW6%3jT_}#<$cpJO`kennvW;(WG~C^L%VM>_KLi0K8Wuc aSKf9@z`nxCUI7lFUw(aI>kQ5nF@6DCLNUGo literal 0 HcmV?d00001 diff --git a/tests/kmBranchDefCpp_cpp/expected/output-map-dynamic.map b/tests/kmBranchDefCpp_cpp/expected/output-map-dynamic.map new file mode 100644 index 0000000..a6a3bb6 --- /dev/null +++ b/tests/kmBranchDefCpp_cpp/expected/output-map-dynamic.map @@ -0,0 +1,17 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000040 000000 __ctor_loc + 00000040 000000 __ctor_end + 00000040 000000 _e_text + 00000040 000000 _f_ctors + 00000040 000000 _e_ctors + 00000040 000000 _f_dtors + 00000040 000000 _e_dtors + 00000040 000000 _f_rodata + 00000040 000000 _e_rodata + 00000040 000000 _f_data + 00000040 000000 _e_data + 00000040 000004 localSym diff --git a/tests/kmBranchDefCpp_cpp/expected/output-map-static.map b/tests/kmBranchDefCpp_cpp/expected/output-map-static.map new file mode 100644 index 0000000..dbf9acc --- /dev/null +++ b/tests/kmBranchDefCpp_cpp/expected/output-map-static.map @@ -0,0 +1,17 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000040 000000 __ctor_loc + 82000040 000000 __ctor_end + 82000040 000000 _e_text + 82000040 000000 _f_ctors + 82000040 000000 _e_ctors + 82000040 000000 _f_dtors + 82000040 000000 _e_dtors + 82000040 000000 _f_rodata + 82000040 000000 _e_rodata + 82000040 000000 _f_data + 82000040 000000 _e_data + 82000040 000004 localSym diff --git a/tests/kmBranchDefCpp_cpp/expected/output-riiv.xml b/tests/kmBranchDefCpp_cpp/expected/output-riiv.xml new file mode 100644 index 0000000..cefeb34 --- /dev/null +++ b/tests/kmBranchDefCpp_cpp/expected/output-riiv.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/tests/kmBranchDefCpp_cpp/externals.txt b/tests/kmBranchDefCpp_cpp/externals.txt new file mode 100644 index 0000000..37ace3f --- /dev/null +++ b/tests/kmBranchDefCpp_cpp/externals.txt @@ -0,0 +1,5 @@ +externalSym=0x81000000 +externalFunc01=0x81000010 +externalFunc02=0x81000020 +externalFunc03=0x81000030 +externalFunc04=0x81000040 \ No newline at end of file diff --git a/tests/kmBranchDefCpp_cpp/test.cpp b/tests/kmBranchDefCpp_cpp/test.cpp new file mode 100644 index 0000000..5527bf2 --- /dev/null +++ b/tests/kmBranchDefCpp_cpp/test.cpp @@ -0,0 +1,18 @@ +#include + +extern int externalSym; +int localSym; + +extern int externalFunc01; +extern int externalFunc02; +extern int externalFunc03; +extern int externalFunc04; + +kmBranchDefCpp(0x80000000, 0x80000004, int, ) { return 1; } +kmBranchDefCpp(0x80000010, &externalSym, int, ) { return 2; } +kmBranchDefCpp(0x80000020, &localSym, int, ) { return 3; } +kmBranchDefCpp(0x80000030, 0, int, ) { return 4; } +kmBranchDefCpp(&externalFunc01, 0x80000044, int, ) { return 5; } +kmBranchDefCpp(&externalFunc02, &externalSym, int, ) { return 6; } +kmBranchDefCpp(&externalFunc03, &localSym, int, ) { return 7; } +kmBranchDefCpp(&externalFunc04, 0, int, ) { return 8; } diff --git a/tests/kmBranchDef_asm/expected/output-ar.txt b/tests/kmBranchDef_asm/expected/output-ar.txt new file mode 100644 index 0000000..6750ead --- /dev/null +++ b/tests/kmBranchDef_asm/expected/output-ar.txt @@ -0,0 +1,6 @@ +04000000 38600001 +04000004 4E800020 +04000008 38600002 +0400000C 4E800020 +04000000 4A000000 +05000000 49000008 \ No newline at end of file diff --git a/tests/kmBranchDef_asm/expected/output-code.bin b/tests/kmBranchDef_asm/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..d932a5f4068a9a2432638b6251a2afbc5afeda0b GIT binary patch literal 16 UcmcCWU|{rXU{J6~U|<5#02;>w5C8xG literal 0 HcmV?d00001 diff --git a/tests/kmBranchDef_asm/expected/output-dolphin.ini b/tests/kmBranchDef_asm/expected/output-dolphin.ini new file mode 100644 index 0000000..bbeda6d --- /dev/null +++ b/tests/kmBranchDef_asm/expected/output-dolphin.ini @@ -0,0 +1,6 @@ +0x82000000:dword:0x38600001 +0x82000004:dword:0x4E800020 +0x82000008:dword:0x38600002 +0x8200000C:dword:0x4E800020 +0x80000000:dword:0x4A000000 +0x81000000:dword:0x49000008 \ No newline at end of file diff --git a/tests/kmBranchDef_asm/expected/output-gecko.txt b/tests/kmBranchDef_asm/expected/output-gecko.txt new file mode 100644 index 0000000..3fd1030 --- /dev/null +++ b/tests/kmBranchDef_asm/expected/output-gecko.txt @@ -0,0 +1,5 @@ +06000000 00000010 +38600001 4E800020 +38600002 4E800020 +04000000 4A000000 +05000000 49000008 \ No newline at end of file diff --git a/tests/kmBranchDef_asm/expected/output-kamek.Base.bin b/tests/kmBranchDef_asm/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..c2481a49eb53b27ac293ce7fa224f7c882f153e4 GIT binary patch literal 72 xcmeZH%uUT^U|?c^00AHc!(b7M1O`UG1_lKn%><$y{{R2i08z^TVmCtA8~|$U46FbE literal 0 HcmV?d00001 diff --git a/tests/kmBranchDef_asm/expected/output-kamek.V2.bin b/tests/kmBranchDef_asm/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..6613759f88feed7739606af91ed0304a2193a5f0 GIT binary patch literal 72 zcmeZH%uUT^U|?c^00AHc!(b7M1O`UG1_lKn%><$y{{R2i08z^TVmE@7GjIR^YfKEh literal 0 HcmV?d00001 diff --git a/tests/kmBranchDef_asm/expected/output-map-dynamic.map b/tests/kmBranchDef_asm/expected/output-map-dynamic.map new file mode 100644 index 0000000..11c0e2a --- /dev/null +++ b/tests/kmBranchDef_asm/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000010 000000 __ctor_loc + 00000010 000000 __ctor_end + 00000010 000000 _e_text + 00000010 000000 _f_ctors + 00000010 000000 _e_ctors + 00000010 000000 _f_dtors + 00000010 000000 _e_dtors + 00000010 000000 _f_rodata + 00000010 000000 _e_rodata + 00000010 000000 _f_data + 00000010 000000 _e_data diff --git a/tests/kmBranchDef_asm/expected/output-map-static.map b/tests/kmBranchDef_asm/expected/output-map-static.map new file mode 100644 index 0000000..41dbbd8 --- /dev/null +++ b/tests/kmBranchDef_asm/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000010 000000 __ctor_loc + 82000010 000000 __ctor_end + 82000010 000000 _e_text + 82000010 000000 _f_ctors + 82000010 000000 _e_ctors + 82000010 000000 _f_dtors + 82000010 000000 _e_dtors + 82000010 000000 _f_rodata + 82000010 000000 _e_rodata + 82000010 000000 _f_data + 82000010 000000 _e_data diff --git a/tests/kmBranchDef_asm/expected/output-riiv.xml b/tests/kmBranchDef_asm/expected/output-riiv.xml new file mode 100644 index 0000000..3dafd6c --- /dev/null +++ b/tests/kmBranchDef_asm/expected/output-riiv.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/tests/kmBranchDef_asm/externals.txt b/tests/kmBranchDef_asm/externals.txt new file mode 100644 index 0000000..58e4460 --- /dev/null +++ b/tests/kmBranchDef_asm/externals.txt @@ -0,0 +1 @@ +externalFunc=0x81000000 \ No newline at end of file diff --git a/tests/kmBranchDef_asm/test.S b/tests/kmBranchDef_asm/test.S new file mode 100644 index 0000000..8e0e2fb --- /dev/null +++ b/tests/kmBranchDef_asm/test.S @@ -0,0 +1,10 @@ +#include + +.extern externalFunc + +kmBranchDef 0x80000000 + li r3, 1 + blr +kmBranchDef externalFunc + li r3, 2 + blr diff --git a/tests/kmBranch_asm/expected/output-ar.txt b/tests/kmBranch_asm/expected/output-ar.txt new file mode 100644 index 0000000..e43b449 --- /dev/null +++ b/tests/kmBranch_asm/expected/output-ar.txt @@ -0,0 +1,7 @@ +04000000 00000000 +04000000 48000004 +04000010 48FFFFF0 +04000020 49FFFFE0 +05000010 4B000024 +05000020 4BFFFFE0 +05000030 48FFFFD0 \ No newline at end of file diff --git a/tests/kmBranch_asm/expected/output-code.bin b/tests/kmBranch_asm/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 GIT binary patch literal 4 LcmZQzU|;|M00aO5 literal 0 HcmV?d00001 diff --git a/tests/kmBranch_asm/expected/output-dolphin.ini b/tests/kmBranch_asm/expected/output-dolphin.ini new file mode 100644 index 0000000..1728378 --- /dev/null +++ b/tests/kmBranch_asm/expected/output-dolphin.ini @@ -0,0 +1,7 @@ +0x82000000:dword:0x00000000 +0x80000000:dword:0x48000004 +0x80000010:dword:0x48FFFFF0 +0x80000020:dword:0x49FFFFE0 +0x81000010:dword:0x4B000024 +0x81000020:dword:0x4BFFFFE0 +0x81000030:dword:0x48FFFFD0 \ No newline at end of file diff --git a/tests/kmBranch_asm/expected/output-gecko.txt b/tests/kmBranch_asm/expected/output-gecko.txt new file mode 100644 index 0000000..5f5b008 --- /dev/null +++ b/tests/kmBranch_asm/expected/output-gecko.txt @@ -0,0 +1,8 @@ +06000000 00000008 +00000000 00000000 +04000000 48000004 +04000010 48FFFFF0 +04000020 49FFFFE0 +05000010 4B000024 +05000020 4BFFFFE0 +05000030 48FFFFD0 \ No newline at end of file diff --git a/tests/kmBranch_asm/expected/output-kamek.Base.bin b/tests/kmBranch_asm/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..b10a17f46ebcc5f53e45e2af456871a9048776e7 GIT binary patch literal 108 zcmeZH%uUT^U|?c^02Uwx!%!gx28aLu|1|)4K+FPV3p4`xP__b)31$Pu1R59^OhDp5 NwgOBIkTw9R0RXV_8!Z3; literal 0 HcmV?d00001 diff --git a/tests/kmBranch_asm/expected/output-kamek.V2.bin b/tests/kmBranch_asm/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..678249ccf47b5e71a24a6a42253bac25d08c8c6b GIT binary patch literal 108 zcmeZH%uUT^U|?c^02Uwx!%!gx28aLu|1|)4K+FPV3p6qaz{C}RQeZYvOaQ3H1f&MY MR)DDi(gq+k0Ju^ceE + + + + + + \ No newline at end of file diff --git a/tests/kmBranch_asm/externals.txt b/tests/kmBranch_asm/externals.txt new file mode 100644 index 0000000..05a2afa --- /dev/null +++ b/tests/kmBranch_asm/externals.txt @@ -0,0 +1,4 @@ +externalSym=0x81000000 +externalFunc01=0x81000010 +externalFunc02=0x81000020 +externalFunc03=0x81000030 \ No newline at end of file diff --git a/tests/kmBranch_asm/test.S b/tests/kmBranch_asm/test.S new file mode 100644 index 0000000..17a2411 --- /dev/null +++ b/tests/kmBranch_asm/test.S @@ -0,0 +1,15 @@ +#include + +.extern externalSym +localSym: .long 0 + +.extern externalFunc01 +.extern externalFunc02 +.extern externalFunc03 + +kmBranch 0x80000000, 0x80000004 +kmBranch 0x80000010, externalSym +kmBranch 0x80000020, localSym +kmBranch externalFunc01, 0x80000034 +kmBranch externalFunc02, externalSym +kmBranch externalFunc03, localSym diff --git a/tests/kmBranch_cpp/expected/output-ar.txt b/tests/kmBranch_cpp/expected/output-ar.txt new file mode 100644 index 0000000..7d77f89 --- /dev/null +++ b/tests/kmBranch_cpp/expected/output-ar.txt @@ -0,0 +1,6 @@ +04000000 48000004 +04000010 48FFFFF0 +04000020 49FFFFE0 +05000010 4B000024 +05000020 4BFFFFE0 +05000030 48FFFFD0 \ No newline at end of file diff --git a/tests/kmBranch_cpp/expected/output-code.bin b/tests/kmBranch_cpp/expected/output-code.bin new file mode 100644 index 0000000..e69de29 diff --git a/tests/kmBranch_cpp/expected/output-dolphin.ini b/tests/kmBranch_cpp/expected/output-dolphin.ini new file mode 100644 index 0000000..8c859f9 --- /dev/null +++ b/tests/kmBranch_cpp/expected/output-dolphin.ini @@ -0,0 +1,6 @@ +0x80000000:dword:0x48000004 +0x80000010:dword:0x48FFFFF0 +0x80000020:dword:0x49FFFFE0 +0x81000010:dword:0x4B000024 +0x81000020:dword:0x4BFFFFE0 +0x81000030:dword:0x48FFFFD0 \ No newline at end of file diff --git a/tests/kmBranch_cpp/expected/output-gecko.txt b/tests/kmBranch_cpp/expected/output-gecko.txt new file mode 100644 index 0000000..7d77f89 --- /dev/null +++ b/tests/kmBranch_cpp/expected/output-gecko.txt @@ -0,0 +1,6 @@ +04000000 48000004 +04000010 48FFFFF0 +04000020 49FFFFE0 +05000010 4B000024 +05000020 4BFFFFE0 +05000030 48FFFFD0 \ No newline at end of file diff --git a/tests/kmBranch_cpp/expected/output-kamek.Base.bin b/tests/kmBranch_cpp/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..321ca5663a13029e274cc777f220ab2ae28a4612 GIT binary patch literal 104 zcmeZH%uUT^U|?ckU|<1a4B+tp|Gx&HC=jzi*#eC~K9sEhWP;g1F@XjK1{07tkgWhy J1EdW=Y5=B+8zle$ literal 0 HcmV?d00001 diff --git a/tests/kmBranch_cpp/expected/output-kamek.V2.bin b/tests/kmBranch_cpp/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..489f9ee6fd29a15e71ec950428065162cc32d4cb GIT binary patch literal 104 zcmeZH%uUT^U|?ckU|<1a4B+tp|Gx&HC=jzi*#eCW0t`^L0#FLf28sy))tG?9fouhs K8X#=|QUd_3>Kk + + + + + \ No newline at end of file diff --git a/tests/kmBranch_cpp/externals.txt b/tests/kmBranch_cpp/externals.txt new file mode 100644 index 0000000..05a2afa --- /dev/null +++ b/tests/kmBranch_cpp/externals.txt @@ -0,0 +1,4 @@ +externalSym=0x81000000 +externalFunc01=0x81000010 +externalFunc02=0x81000020 +externalFunc03=0x81000030 \ No newline at end of file diff --git a/tests/kmBranch_cpp/test.cpp b/tests/kmBranch_cpp/test.cpp new file mode 100644 index 0000000..fae9d13 --- /dev/null +++ b/tests/kmBranch_cpp/test.cpp @@ -0,0 +1,15 @@ +#include + +extern int externalSym; +int localSym; + +extern int externalFunc01; +extern int externalFunc02; +extern int externalFunc03; + +kmBranch(0x80000000, 0x80000004); +kmBranch(0x80000010, &externalSym); +kmBranch(0x80000020, &localSym); +kmBranch(&externalFunc01, 0x80000034); +kmBranch(&externalFunc02, &externalSym); +kmBranch(&externalFunc03, &localSym); diff --git a/tests/kmCallDefAsm_cpp/expected/output-ar.txt b/tests/kmCallDefAsm_cpp/expected/output-ar.txt new file mode 100644 index 0000000..8900b64 --- /dev/null +++ b/tests/kmCallDefAsm_cpp/expected/output-ar.txt @@ -0,0 +1,6 @@ +04000000 38600001 +04000004 4E800020 +04000008 38600002 +0400000C 4E800020 +04000000 4A000001 +05000000 49000009 \ No newline at end of file diff --git a/tests/kmCallDefAsm_cpp/expected/output-code.bin b/tests/kmCallDefAsm_cpp/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..d932a5f4068a9a2432638b6251a2afbc5afeda0b GIT binary patch literal 16 UcmcCWU|{rXU{J6~U|<5#02;>w5C8xG literal 0 HcmV?d00001 diff --git a/tests/kmCallDefAsm_cpp/expected/output-dolphin.ini b/tests/kmCallDefAsm_cpp/expected/output-dolphin.ini new file mode 100644 index 0000000..0b9e4bb --- /dev/null +++ b/tests/kmCallDefAsm_cpp/expected/output-dolphin.ini @@ -0,0 +1,6 @@ +0x82000000:dword:0x38600001 +0x82000004:dword:0x4E800020 +0x82000008:dword:0x38600002 +0x8200000C:dword:0x4E800020 +0x80000000:dword:0x4A000001 +0x81000000:dword:0x49000009 \ No newline at end of file diff --git a/tests/kmCallDefAsm_cpp/expected/output-gecko.txt b/tests/kmCallDefAsm_cpp/expected/output-gecko.txt new file mode 100644 index 0000000..2d22d5c --- /dev/null +++ b/tests/kmCallDefAsm_cpp/expected/output-gecko.txt @@ -0,0 +1,5 @@ +06000000 00000010 +38600001 4E800020 +38600002 4E800020 +04000000 4A000001 +05000000 49000009 \ No newline at end of file diff --git a/tests/kmCallDefAsm_cpp/expected/output-kamek.Base.bin b/tests/kmCallDefAsm_cpp/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..4ea88bfa9c52dbe6d0c5540a94c61bf600d08813 GIT binary patch literal 72 xcmeZH%uUT^U|?c^00AHc!(b7M1O`UG1_lKn%><$y|NsBj08z^TVmCtA8~|$&46XnG literal 0 HcmV?d00001 diff --git a/tests/kmCallDefAsm_cpp/expected/output-kamek.V2.bin b/tests/kmCallDefAsm_cpp/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..2178f18f81fae80f88449f38178c58b0d42a8225 GIT binary patch literal 72 zcmeZH%uUT^U|?c^00AHc!(b7M1O`UG1_lKn%><$y|NsBj08z^TVmE@7GjIR^Yj6y{ literal 0 HcmV?d00001 diff --git a/tests/kmCallDefAsm_cpp/expected/output-map-dynamic.map b/tests/kmCallDefAsm_cpp/expected/output-map-dynamic.map new file mode 100644 index 0000000..11c0e2a --- /dev/null +++ b/tests/kmCallDefAsm_cpp/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000010 000000 __ctor_loc + 00000010 000000 __ctor_end + 00000010 000000 _e_text + 00000010 000000 _f_ctors + 00000010 000000 _e_ctors + 00000010 000000 _f_dtors + 00000010 000000 _e_dtors + 00000010 000000 _f_rodata + 00000010 000000 _e_rodata + 00000010 000000 _f_data + 00000010 000000 _e_data diff --git a/tests/kmCallDefAsm_cpp/expected/output-map-static.map b/tests/kmCallDefAsm_cpp/expected/output-map-static.map new file mode 100644 index 0000000..41dbbd8 --- /dev/null +++ b/tests/kmCallDefAsm_cpp/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000010 000000 __ctor_loc + 82000010 000000 __ctor_end + 82000010 000000 _e_text + 82000010 000000 _f_ctors + 82000010 000000 _e_ctors + 82000010 000000 _f_dtors + 82000010 000000 _e_dtors + 82000010 000000 _f_rodata + 82000010 000000 _e_rodata + 82000010 000000 _f_data + 82000010 000000 _e_data diff --git a/tests/kmCallDefAsm_cpp/expected/output-riiv.xml b/tests/kmCallDefAsm_cpp/expected/output-riiv.xml new file mode 100644 index 0000000..697781b --- /dev/null +++ b/tests/kmCallDefAsm_cpp/expected/output-riiv.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/tests/kmCallDefAsm_cpp/externals.txt b/tests/kmCallDefAsm_cpp/externals.txt new file mode 100644 index 0000000..4c6c225 --- /dev/null +++ b/tests/kmCallDefAsm_cpp/externals.txt @@ -0,0 +1 @@ +externalFunc=0x81000000 diff --git a/tests/kmCallDefAsm_cpp/test.cpp b/tests/kmCallDefAsm_cpp/test.cpp new file mode 100644 index 0000000..a1daf92 --- /dev/null +++ b/tests/kmCallDefAsm_cpp/test.cpp @@ -0,0 +1,6 @@ +#include + +extern int externalFunc; + +kmCallDefAsm(0x80000000) { li r3, 1 } +kmCallDefAsm(&externalFunc) { li r3, 2 } diff --git a/tests/kmCallDefCpp_cpp/expected/output-ar.txt b/tests/kmCallDefCpp_cpp/expected/output-ar.txt new file mode 100644 index 0000000..8900b64 --- /dev/null +++ b/tests/kmCallDefCpp_cpp/expected/output-ar.txt @@ -0,0 +1,6 @@ +04000000 38600001 +04000004 4E800020 +04000008 38600002 +0400000C 4E800020 +04000000 4A000001 +05000000 49000009 \ No newline at end of file diff --git a/tests/kmCallDefCpp_cpp/expected/output-code.bin b/tests/kmCallDefCpp_cpp/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..d932a5f4068a9a2432638b6251a2afbc5afeda0b GIT binary patch literal 16 UcmcCWU|{rXU{J6~U|<5#02;>w5C8xG literal 0 HcmV?d00001 diff --git a/tests/kmCallDefCpp_cpp/expected/output-dolphin.ini b/tests/kmCallDefCpp_cpp/expected/output-dolphin.ini new file mode 100644 index 0000000..0b9e4bb --- /dev/null +++ b/tests/kmCallDefCpp_cpp/expected/output-dolphin.ini @@ -0,0 +1,6 @@ +0x82000000:dword:0x38600001 +0x82000004:dword:0x4E800020 +0x82000008:dword:0x38600002 +0x8200000C:dword:0x4E800020 +0x80000000:dword:0x4A000001 +0x81000000:dword:0x49000009 \ No newline at end of file diff --git a/tests/kmCallDefCpp_cpp/expected/output-gecko.txt b/tests/kmCallDefCpp_cpp/expected/output-gecko.txt new file mode 100644 index 0000000..2d22d5c --- /dev/null +++ b/tests/kmCallDefCpp_cpp/expected/output-gecko.txt @@ -0,0 +1,5 @@ +06000000 00000010 +38600001 4E800020 +38600002 4E800020 +04000000 4A000001 +05000000 49000009 \ No newline at end of file diff --git a/tests/kmCallDefCpp_cpp/expected/output-kamek.Base.bin b/tests/kmCallDefCpp_cpp/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..4ea88bfa9c52dbe6d0c5540a94c61bf600d08813 GIT binary patch literal 72 xcmeZH%uUT^U|?c^00AHc!(b7M1O`UG1_lKn%><$y|NsBj08z^TVmCtA8~|$&46XnG literal 0 HcmV?d00001 diff --git a/tests/kmCallDefCpp_cpp/expected/output-kamek.V2.bin b/tests/kmCallDefCpp_cpp/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..2178f18f81fae80f88449f38178c58b0d42a8225 GIT binary patch literal 72 zcmeZH%uUT^U|?c^00AHc!(b7M1O`UG1_lKn%><$y|NsBj08z^TVmE@7GjIR^Yj6y{ literal 0 HcmV?d00001 diff --git a/tests/kmCallDefCpp_cpp/expected/output-map-dynamic.map b/tests/kmCallDefCpp_cpp/expected/output-map-dynamic.map new file mode 100644 index 0000000..11c0e2a --- /dev/null +++ b/tests/kmCallDefCpp_cpp/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000010 000000 __ctor_loc + 00000010 000000 __ctor_end + 00000010 000000 _e_text + 00000010 000000 _f_ctors + 00000010 000000 _e_ctors + 00000010 000000 _f_dtors + 00000010 000000 _e_dtors + 00000010 000000 _f_rodata + 00000010 000000 _e_rodata + 00000010 000000 _f_data + 00000010 000000 _e_data diff --git a/tests/kmCallDefCpp_cpp/expected/output-map-static.map b/tests/kmCallDefCpp_cpp/expected/output-map-static.map new file mode 100644 index 0000000..41dbbd8 --- /dev/null +++ b/tests/kmCallDefCpp_cpp/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000010 000000 __ctor_loc + 82000010 000000 __ctor_end + 82000010 000000 _e_text + 82000010 000000 _f_ctors + 82000010 000000 _e_ctors + 82000010 000000 _f_dtors + 82000010 000000 _e_dtors + 82000010 000000 _f_rodata + 82000010 000000 _e_rodata + 82000010 000000 _f_data + 82000010 000000 _e_data diff --git a/tests/kmCallDefCpp_cpp/expected/output-riiv.xml b/tests/kmCallDefCpp_cpp/expected/output-riiv.xml new file mode 100644 index 0000000..697781b --- /dev/null +++ b/tests/kmCallDefCpp_cpp/expected/output-riiv.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/tests/kmCallDefCpp_cpp/externals.txt b/tests/kmCallDefCpp_cpp/externals.txt new file mode 100644 index 0000000..4c6c225 --- /dev/null +++ b/tests/kmCallDefCpp_cpp/externals.txt @@ -0,0 +1 @@ +externalFunc=0x81000000 diff --git a/tests/kmCallDefCpp_cpp/test.cpp b/tests/kmCallDefCpp_cpp/test.cpp new file mode 100644 index 0000000..06201e0 --- /dev/null +++ b/tests/kmCallDefCpp_cpp/test.cpp @@ -0,0 +1,6 @@ +#include + +extern int externalFunc; + +kmCallDefCpp(0x80000000, int, ) { return 1; } +kmCallDefCpp(&externalFunc, int, ) { return 2; } diff --git a/tests/kmCallDef_asm/expected/output-ar.txt b/tests/kmCallDef_asm/expected/output-ar.txt new file mode 100644 index 0000000..8900b64 --- /dev/null +++ b/tests/kmCallDef_asm/expected/output-ar.txt @@ -0,0 +1,6 @@ +04000000 38600001 +04000004 4E800020 +04000008 38600002 +0400000C 4E800020 +04000000 4A000001 +05000000 49000009 \ No newline at end of file diff --git a/tests/kmCallDef_asm/expected/output-code.bin b/tests/kmCallDef_asm/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..d932a5f4068a9a2432638b6251a2afbc5afeda0b GIT binary patch literal 16 UcmcCWU|{rXU{J6~U|<5#02;>w5C8xG literal 0 HcmV?d00001 diff --git a/tests/kmCallDef_asm/expected/output-dolphin.ini b/tests/kmCallDef_asm/expected/output-dolphin.ini new file mode 100644 index 0000000..0b9e4bb --- /dev/null +++ b/tests/kmCallDef_asm/expected/output-dolphin.ini @@ -0,0 +1,6 @@ +0x82000000:dword:0x38600001 +0x82000004:dword:0x4E800020 +0x82000008:dword:0x38600002 +0x8200000C:dword:0x4E800020 +0x80000000:dword:0x4A000001 +0x81000000:dword:0x49000009 \ No newline at end of file diff --git a/tests/kmCallDef_asm/expected/output-gecko.txt b/tests/kmCallDef_asm/expected/output-gecko.txt new file mode 100644 index 0000000..2d22d5c --- /dev/null +++ b/tests/kmCallDef_asm/expected/output-gecko.txt @@ -0,0 +1,5 @@ +06000000 00000010 +38600001 4E800020 +38600002 4E800020 +04000000 4A000001 +05000000 49000009 \ No newline at end of file diff --git a/tests/kmCallDef_asm/expected/output-kamek.Base.bin b/tests/kmCallDef_asm/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..4ea88bfa9c52dbe6d0c5540a94c61bf600d08813 GIT binary patch literal 72 xcmeZH%uUT^U|?c^00AHc!(b7M1O`UG1_lKn%><$y|NsBj08z^TVmCtA8~|$&46XnG literal 0 HcmV?d00001 diff --git a/tests/kmCallDef_asm/expected/output-kamek.V2.bin b/tests/kmCallDef_asm/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..2178f18f81fae80f88449f38178c58b0d42a8225 GIT binary patch literal 72 zcmeZH%uUT^U|?c^00AHc!(b7M1O`UG1_lKn%><$y|NsBj08z^TVmE@7GjIR^Yj6y{ literal 0 HcmV?d00001 diff --git a/tests/kmCallDef_asm/expected/output-map-dynamic.map b/tests/kmCallDef_asm/expected/output-map-dynamic.map new file mode 100644 index 0000000..11c0e2a --- /dev/null +++ b/tests/kmCallDef_asm/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000010 000000 __ctor_loc + 00000010 000000 __ctor_end + 00000010 000000 _e_text + 00000010 000000 _f_ctors + 00000010 000000 _e_ctors + 00000010 000000 _f_dtors + 00000010 000000 _e_dtors + 00000010 000000 _f_rodata + 00000010 000000 _e_rodata + 00000010 000000 _f_data + 00000010 000000 _e_data diff --git a/tests/kmCallDef_asm/expected/output-map-static.map b/tests/kmCallDef_asm/expected/output-map-static.map new file mode 100644 index 0000000..41dbbd8 --- /dev/null +++ b/tests/kmCallDef_asm/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000010 000000 __ctor_loc + 82000010 000000 __ctor_end + 82000010 000000 _e_text + 82000010 000000 _f_ctors + 82000010 000000 _e_ctors + 82000010 000000 _f_dtors + 82000010 000000 _e_dtors + 82000010 000000 _f_rodata + 82000010 000000 _e_rodata + 82000010 000000 _f_data + 82000010 000000 _e_data diff --git a/tests/kmCallDef_asm/expected/output-riiv.xml b/tests/kmCallDef_asm/expected/output-riiv.xml new file mode 100644 index 0000000..697781b --- /dev/null +++ b/tests/kmCallDef_asm/expected/output-riiv.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/tests/kmCallDef_asm/externals.txt b/tests/kmCallDef_asm/externals.txt new file mode 100644 index 0000000..58e4460 --- /dev/null +++ b/tests/kmCallDef_asm/externals.txt @@ -0,0 +1 @@ +externalFunc=0x81000000 \ No newline at end of file diff --git a/tests/kmCallDef_asm/test.S b/tests/kmCallDef_asm/test.S new file mode 100644 index 0000000..8f83a19 --- /dev/null +++ b/tests/kmCallDef_asm/test.S @@ -0,0 +1,10 @@ +#include + +.extern externalFunc + +kmCallDef 0x80000000 + li r3, 1 + blr +kmCallDef externalFunc + li r3, 2 + blr diff --git a/tests/kmCall_asm/expected/output-ar.txt b/tests/kmCall_asm/expected/output-ar.txt new file mode 100644 index 0000000..59afbfa --- /dev/null +++ b/tests/kmCall_asm/expected/output-ar.txt @@ -0,0 +1,7 @@ +04000000 00000000 +04000000 48000005 +04000010 48FFFFF1 +04000020 49FFFFE1 +05000010 4B000025 +05000020 4BFFFFE1 +05000030 48FFFFD1 \ No newline at end of file diff --git a/tests/kmCall_asm/expected/output-code.bin b/tests/kmCall_asm/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 GIT binary patch literal 4 LcmZQzU|;|M00aO5 literal 0 HcmV?d00001 diff --git a/tests/kmCall_asm/expected/output-dolphin.ini b/tests/kmCall_asm/expected/output-dolphin.ini new file mode 100644 index 0000000..0fbca90 --- /dev/null +++ b/tests/kmCall_asm/expected/output-dolphin.ini @@ -0,0 +1,7 @@ +0x82000000:dword:0x00000000 +0x80000000:dword:0x48000005 +0x80000010:dword:0x48FFFFF1 +0x80000020:dword:0x49FFFFE1 +0x81000010:dword:0x4B000025 +0x81000020:dword:0x4BFFFFE1 +0x81000030:dword:0x48FFFFD1 \ No newline at end of file diff --git a/tests/kmCall_asm/expected/output-gecko.txt b/tests/kmCall_asm/expected/output-gecko.txt new file mode 100644 index 0000000..05d673c --- /dev/null +++ b/tests/kmCall_asm/expected/output-gecko.txt @@ -0,0 +1,8 @@ +06000000 00000008 +00000000 00000000 +04000000 48000005 +04000010 48FFFFF1 +04000020 49FFFFE1 +05000010 4B000025 +05000020 4BFFFFE1 +05000030 48FFFFD1 \ No newline at end of file diff --git a/tests/kmCall_asm/expected/output-kamek.Base.bin b/tests/kmCall_asm/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..42fe5c5b4025d1b4dad41266972359b0e781e271 GIT binary patch literal 108 zcmeZH%uUT^U|?c^02Uwx!%!gx2FL&Z|1|)4K+FPV3p4`xP__b)31$Pu1R59^OhDp5 NwgOBIkTw9R0RXY?8#4d^ literal 0 HcmV?d00001 diff --git a/tests/kmCall_asm/expected/output-kamek.V2.bin b/tests/kmCall_asm/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..dd98216b8be1f1d96d6edff6e81f3a2d5767865a GIT binary patch literal 108 zcmeZH%uUT^U|?c^02Uwx!%!gx2FL&Z|1|)4K+FPV3p6qaz{C}RQeZYvOaQ3H1f&MY MR)DDi(gq+k0J%;Zg8%>k literal 0 HcmV?d00001 diff --git a/tests/kmCall_asm/expected/output-map-dynamic.map b/tests/kmCall_asm/expected/output-map-dynamic.map new file mode 100644 index 0000000..e9d7ae6 --- /dev/null +++ b/tests/kmCall_asm/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000004 000000 __ctor_loc + 00000004 000000 __ctor_end + 00000004 000000 _e_text + 00000004 000000 _f_ctors + 00000004 000000 _e_ctors + 00000004 000000 _f_dtors + 00000004 000000 _e_dtors + 00000004 000000 _f_rodata + 00000004 000000 _e_rodata + 00000004 000000 _f_data + 00000004 000000 _e_data diff --git a/tests/kmCall_asm/expected/output-map-static.map b/tests/kmCall_asm/expected/output-map-static.map new file mode 100644 index 0000000..bf756ba --- /dev/null +++ b/tests/kmCall_asm/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000004 000000 __ctor_loc + 82000004 000000 __ctor_end + 82000004 000000 _e_text + 82000004 000000 _f_ctors + 82000004 000000 _e_ctors + 82000004 000000 _f_dtors + 82000004 000000 _e_dtors + 82000004 000000 _f_rodata + 82000004 000000 _e_rodata + 82000004 000000 _f_data + 82000004 000000 _e_data diff --git a/tests/kmCall_asm/expected/output-riiv.xml b/tests/kmCall_asm/expected/output-riiv.xml new file mode 100644 index 0000000..895a132 --- /dev/null +++ b/tests/kmCall_asm/expected/output-riiv.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/tests/kmCall_asm/externals.txt b/tests/kmCall_asm/externals.txt new file mode 100644 index 0000000..05a2afa --- /dev/null +++ b/tests/kmCall_asm/externals.txt @@ -0,0 +1,4 @@ +externalSym=0x81000000 +externalFunc01=0x81000010 +externalFunc02=0x81000020 +externalFunc03=0x81000030 \ No newline at end of file diff --git a/tests/kmCall_asm/test.S b/tests/kmCall_asm/test.S new file mode 100644 index 0000000..ee09490 --- /dev/null +++ b/tests/kmCall_asm/test.S @@ -0,0 +1,15 @@ +#include + +.extern externalSym +localSym: .long 0 + +.extern externalFunc01 +.extern externalFunc02 +.extern externalFunc03 + +kmCall 0x80000000, 0x80000004 +kmCall 0x80000010, externalSym +kmCall 0x80000020, localSym +kmCall externalFunc01, 0x80000034 +kmCall externalFunc02, externalSym +kmCall externalFunc03, localSym diff --git a/tests/kmCall_cpp/expected/output-ar.txt b/tests/kmCall_cpp/expected/output-ar.txt new file mode 100644 index 0000000..66ca567 --- /dev/null +++ b/tests/kmCall_cpp/expected/output-ar.txt @@ -0,0 +1,6 @@ +04000000 48000005 +04000010 48FFFFF1 +04000020 49FFFFE1 +05000010 4B000025 +05000020 4BFFFFE1 +05000030 48FFFFD1 \ No newline at end of file diff --git a/tests/kmCall_cpp/expected/output-code.bin b/tests/kmCall_cpp/expected/output-code.bin new file mode 100644 index 0000000..e69de29 diff --git a/tests/kmCall_cpp/expected/output-dolphin.ini b/tests/kmCall_cpp/expected/output-dolphin.ini new file mode 100644 index 0000000..38ab00b --- /dev/null +++ b/tests/kmCall_cpp/expected/output-dolphin.ini @@ -0,0 +1,6 @@ +0x80000000:dword:0x48000005 +0x80000010:dword:0x48FFFFF1 +0x80000020:dword:0x49FFFFE1 +0x81000010:dword:0x4B000025 +0x81000020:dword:0x4BFFFFE1 +0x81000030:dword:0x48FFFFD1 \ No newline at end of file diff --git a/tests/kmCall_cpp/expected/output-gecko.txt b/tests/kmCall_cpp/expected/output-gecko.txt new file mode 100644 index 0000000..66ca567 --- /dev/null +++ b/tests/kmCall_cpp/expected/output-gecko.txt @@ -0,0 +1,6 @@ +04000000 48000005 +04000010 48FFFFF1 +04000020 49FFFFE1 +05000010 4B000025 +05000020 4BFFFFE1 +05000030 48FFFFD1 \ No newline at end of file diff --git a/tests/kmCall_cpp/expected/output-kamek.Base.bin b/tests/kmCall_cpp/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..7a864250269a24d32a66fef7728df154717ff256 GIT binary patch literal 104 zcmeZH%uUT^U|?ckU|<1a4B+_x|Gx&HC=jzi*#eC~K9sEhWP;g1F@XjK1{07tkgWhy J1EdW=Y5=E(8!G?+ literal 0 HcmV?d00001 diff --git a/tests/kmCall_cpp/expected/output-kamek.V2.bin b/tests/kmCall_cpp/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..4ceb8e7f8bea29da01230b322018e25bacfcb520 GIT binary patch literal 104 zcmeZH%uUT^U|?ckU|<1a4B+_x|Gx&HC=jzi*#eCW0t`^L0#FLf28sy))tG?9fouhs K8X#=|QUd_4<{Nte literal 0 HcmV?d00001 diff --git a/tests/kmCall_cpp/expected/output-map-dynamic.map b/tests/kmCall_cpp/expected/output-map-dynamic.map new file mode 100644 index 0000000..dd8b8d4 --- /dev/null +++ b/tests/kmCall_cpp/expected/output-map-dynamic.map @@ -0,0 +1,17 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 __ctor_loc + 00000000 000000 __ctor_end + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000000 000000 _e_text + 00000000 000000 _f_ctors + 00000000 000000 _e_ctors + 00000000 000000 _f_dtors + 00000000 000000 _e_dtors + 00000000 000000 _f_rodata + 00000000 000000 _e_rodata + 00000000 000000 _f_data + 00000000 000000 _e_data + 00000000 000004 localSym diff --git a/tests/kmCall_cpp/expected/output-map-static.map b/tests/kmCall_cpp/expected/output-map-static.map new file mode 100644 index 0000000..b030be5 --- /dev/null +++ b/tests/kmCall_cpp/expected/output-map-static.map @@ -0,0 +1,17 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 __ctor_loc + 82000000 000000 __ctor_end + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000000 000000 _e_text + 82000000 000000 _f_ctors + 82000000 000000 _e_ctors + 82000000 000000 _f_dtors + 82000000 000000 _e_dtors + 82000000 000000 _f_rodata + 82000000 000000 _e_rodata + 82000000 000000 _f_data + 82000000 000000 _e_data + 82000000 000004 localSym diff --git a/tests/kmCall_cpp/expected/output-riiv.xml b/tests/kmCall_cpp/expected/output-riiv.xml new file mode 100644 index 0000000..93ac23d --- /dev/null +++ b/tests/kmCall_cpp/expected/output-riiv.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tests/kmCall_cpp/externals.txt b/tests/kmCall_cpp/externals.txt new file mode 100644 index 0000000..05a2afa --- /dev/null +++ b/tests/kmCall_cpp/externals.txt @@ -0,0 +1,4 @@ +externalSym=0x81000000 +externalFunc01=0x81000010 +externalFunc02=0x81000020 +externalFunc03=0x81000030 \ No newline at end of file diff --git a/tests/kmCall_cpp/test.cpp b/tests/kmCall_cpp/test.cpp new file mode 100644 index 0000000..721c729 --- /dev/null +++ b/tests/kmCall_cpp/test.cpp @@ -0,0 +1,15 @@ +#include + +extern int externalSym; +int localSym; + +extern int externalFunc01; +extern int externalFunc02; +extern int externalFunc03; + +kmCall(0x80000000, 0x80000004); +kmCall(0x80000010, &externalSym); +kmCall(0x80000020, &localSym); +kmCall(&externalFunc01, 0x80000034); +kmCall(&externalFunc02, &externalSym); +kmCall(&externalFunc03, &localSym); diff --git a/tests/kmPatchExitPoint/expected/output-ar.txt b/tests/kmPatchExitPoint/expected/output-ar.txt new file mode 100644 index 0000000..bd2c0b8 --- /dev/null +++ b/tests/kmPatchExitPoint/expected/output-ar.txt @@ -0,0 +1,4 @@ +04000000 4A000000 +04000004 4AFFFFFC +04000008 48000008 +0400000C 4E800020 \ No newline at end of file diff --git a/tests/kmPatchExitPoint/expected/output-code.bin b/tests/kmPatchExitPoint/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..caf16a9e4d4234e76e3c33fe989cfbb73f252e49 GIT binary patch literal 16 XcmeZbU|{h2|NoB%0|SR&1A_tpD=!4i literal 0 HcmV?d00001 diff --git a/tests/kmPatchExitPoint/expected/output-dolphin.ini b/tests/kmPatchExitPoint/expected/output-dolphin.ini new file mode 100644 index 0000000..1edb64d --- /dev/null +++ b/tests/kmPatchExitPoint/expected/output-dolphin.ini @@ -0,0 +1,4 @@ +0x82000000:dword:0x4A000000 +0x82000004:dword:0x4AFFFFFC +0x82000008:dword:0x48000008 +0x8200000C:dword:0x4E800020 \ No newline at end of file diff --git a/tests/kmPatchExitPoint/expected/output-gecko.txt b/tests/kmPatchExitPoint/expected/output-gecko.txt new file mode 100644 index 0000000..1bd54d0 --- /dev/null +++ b/tests/kmPatchExitPoint/expected/output-gecko.txt @@ -0,0 +1,3 @@ +06000000 00000010 +4A000000 4AFFFFFC +48000008 4E800020 \ No newline at end of file diff --git a/tests/kmPatchExitPoint/expected/output-kamek.Base.bin b/tests/kmPatchExitPoint/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..035efa2bf48f09d1e5379b46e732f15041cb28b4 GIT binary patch literal 64 wcmeZH%uUT^U|?ckU|<1a0VE7$GBEfxFereq2Ll5Kh;{&qH2^V?W@!Y{0Nr2)zW@LL literal 0 HcmV?d00001 diff --git a/tests/kmPatchExitPoint/expected/output-kamek.V2.bin b/tests/kmPatchExitPoint/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..9a0c0895cf5077ac432d990d6f9951a5f1242743 GIT binary patch literal 64 xcmeZH%uUT^U|?ckU|<1a0VE7$GBEfxFereq2Ll5Kh;{&qH2^V?W@!W}2LRoG2G0Nh literal 0 HcmV?d00001 diff --git a/tests/kmPatchExitPoint/expected/output-map-dynamic.map b/tests/kmPatchExitPoint/expected/output-map-dynamic.map new file mode 100644 index 0000000..8b507ee --- /dev/null +++ b/tests/kmPatchExitPoint/expected/output-map-dynamic.map @@ -0,0 +1,21 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000000 000004 localFunc01__Fv + 00000004 000004 localFunc02__Fv + 00000008 000004 localFunc03__Fv + 0000000C 000004 localFunc04__Fv + 00000010 000000 __ctor_loc + 00000010 000000 __ctor_end + 00000010 000000 _e_text + 00000010 000000 _f_ctors + 00000010 000000 _e_ctors + 00000010 000000 _f_dtors + 00000010 000000 _e_dtors + 00000010 000000 _f_rodata + 00000010 000000 _e_rodata + 00000010 000000 _f_data + 00000010 000000 _e_data + 00000010 000004 localSym diff --git a/tests/kmPatchExitPoint/expected/output-map-static.map b/tests/kmPatchExitPoint/expected/output-map-static.map new file mode 100644 index 0000000..9ca6de8 --- /dev/null +++ b/tests/kmPatchExitPoint/expected/output-map-static.map @@ -0,0 +1,21 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000000 000004 localFunc01__Fv + 82000004 000004 localFunc02__Fv + 82000008 000004 localFunc03__Fv + 8200000C 000004 localFunc04__Fv + 82000010 000000 __ctor_loc + 82000010 000000 __ctor_end + 82000010 000000 _e_text + 82000010 000000 _f_ctors + 82000010 000000 _e_ctors + 82000010 000000 _f_dtors + 82000010 000000 _e_dtors + 82000010 000000 _f_rodata + 82000010 000000 _e_rodata + 82000010 000000 _f_data + 82000010 000000 _e_data + 82000010 000004 localSym diff --git a/tests/kmPatchExitPoint/expected/output-riiv.xml b/tests/kmPatchExitPoint/expected/output-riiv.xml new file mode 100644 index 0000000..92b7577 --- /dev/null +++ b/tests/kmPatchExitPoint/expected/output-riiv.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/kmPatchExitPoint/externals.txt b/tests/kmPatchExitPoint/externals.txt new file mode 100644 index 0000000..f1fe089 --- /dev/null +++ b/tests/kmPatchExitPoint/externals.txt @@ -0,0 +1 @@ +externalSym=0x81000000 diff --git a/tests/kmPatchExitPoint/test.cpp b/tests/kmPatchExitPoint/test.cpp new file mode 100644 index 0000000..803f9dc --- /dev/null +++ b/tests/kmPatchExitPoint/test.cpp @@ -0,0 +1,14 @@ +#include + +extern int externalSym; +int localSym; + +void localFunc01() {} +void localFunc02() {} +void localFunc03() {} +void localFunc04() {} + +kmPatchExitPoint(localFunc01, 0x80000000); +kmPatchExitPoint(localFunc02, &externalSym); +kmPatchExitPoint(localFunc03, &localSym); +kmPatchExitPoint(localFunc04, 0); diff --git a/tests/run_tests.py b/tests/run_tests.py new file mode 100644 index 0000000..d2cf14f --- /dev/null +++ b/tests/run_tests.py @@ -0,0 +1,124 @@ +from pathlib import Path +import shutil +import subprocess +import sys + + +CW = Path('../cw') +MWCCEPPC_EXE = CW / 'mwcceppc.exe' +MWASMEPPC_EXE = CW / 'mwasmeppc.exe' +CFLAGS = [ + '-I-', + '-i', '../k_stdlib', + '-Cpp_exceptions', 'off', + '-enum', 'int', + '-Os', + '-use_lmw_stmw', 'on', + '-fp', 'hard', + '-rostr', + '-sdata', '0', + '-sdata2', '0', +] +ASMFLAGS = [ + '-I-', + '-i', '../k_stdlib', +] +KAMEK_EXE = Path('../Kamek') + + +def compile_cpp(cpp_path: Path, o_path: Path) -> None: + subprocess.run(['wine', str(MWCCEPPC_EXE), *CFLAGS, '-c', '-o', str(o_path), str(cpp_path)]) + if not o_path.is_file(): + raise ValueError(f'{MWCCEPPC_EXE} failed to produce {o_path}') + + +def compile_s(s_path: Path, o_path: Path) -> None: + subprocess.run(['wine', str(MWASMEPPC_EXE), *ASMFLAGS, '-c', '-o', str(o_path), str(s_path)]) + if not o_path.is_file(): + raise ValueError(f'{MWASMEPPC_EXE} failed to produce {o_path}') + + +def kamek_static_link(o_files: list[Path], *, static: int, externals: Path, output_dir: Path) -> None: + subprocess.run([ + str(KAMEK_EXE), + '-q', + f'-static=0x{static:08x}', + f'-externals={externals}', + f'-output-riiv={output_dir / "output-riiv.xml"}', + f'-output-dolphin={output_dir / "output-dolphin.ini"}', + f'-output-gecko={output_dir / "output-gecko.txt"}', + f'-output-ar={output_dir / "output-ar.txt"}', + f'-output-code={output_dir / "output-code.bin"}', + f'-output-map={output_dir / "output-map-static.map"}', + *(str(o) for o in o_files), + ]) + + +def kamek_dynamic_link(o_files: list[Path], *, externals: Path, versions: Path, output_dir: Path) -> None: + subprocess.run([ + str(KAMEK_EXE), + '-q', + '-dynamic', + f'-externals={externals}', + f'-versions={versions}', + f'-output-kamek={output_dir / "output-kamek.$KV$.bin"}', + f'-output-map={output_dir / "output-map-dynamic.map"}', + *(str(o) for o in o_files), + ]) + + +def main() -> None: + for test_dir in Path().iterdir(): + if not test_dir.is_dir(): + continue + + bin_dir = test_dir / '_bin' + out_dir = test_dir / '_out' + + shutil.rmtree(bin_dir, ignore_errors=True) + bin_dir.mkdir() + shutil.rmtree(out_dir, ignore_errors=True) + out_dir.mkdir() + + o_files = [] + for cpp_file in test_dir.glob('*.cpp'): + o_file = bin_dir / cpp_file.with_suffix('.o').name + compile_cpp(cpp_file, o_file) + o_files.append(o_file) + for s_file in test_dir.glob('*.S'): + o_file = bin_dir / s_file.with_suffix('.o').name + compile_s(s_file, o_file) + o_files.append(o_file) + + kamek_static_link( + o_files, + static=0x82000000, + externals=test_dir / 'externals.txt', + output_dir=out_dir, + ) + kamek_dynamic_link( + o_files, + externals=test_dir / 'externals.txt', + versions=Path('versions.txt'), + output_dir=out_dir, + ) + + expected_dir = test_dir / 'expected' + + if '--bless' in sys.argv: + shutil.rmtree(expected_dir, ignore_errors=True) + out_dir.rename(expected_dir) + + else: + for expected_file in expected_dir.iterdir(): + actual_file = out_dir / expected_file.name + + if not actual_file.is_file(): + raise ValueError(f'{actual_file} is missing') + if expected_file.read_bytes() != actual_file.read_bytes(): + raise ValueError(f'{expected_file} and {actual_file} are different!') + + print('All tests passed successfully') + + +main() diff --git a/tests/versions.txt b/tests/versions.txt new file mode 100644 index 0000000..2ddfb86 --- /dev/null +++ b/tests/versions.txt @@ -0,0 +1,7 @@ +[Base] +80000000-*: +0x0 + +[V2] +extend Base +80000000-80ffffff: +0x0 +81000000-*: +0x1000 diff --git a/tests/writes_asm/expected/output-ar.txt b/tests/writes_asm/expected/output-ar.txt new file mode 100644 index 0000000..08bc424 --- /dev/null +++ b/tests/writes_asm/expected/output-ar.txt @@ -0,0 +1,29 @@ +04000000 00000000 +0C000000 80000004 +04000000 80000008 +0C000010 80000014 +04000010 81000000 +0C000020 80000024 +04000020 82000000 +0C000030 81000000 +04000030 80000038 +0C000040 81000000 +04000040 81000000 +0C000050 81000000 +04000050 82000000 +0C000100 11111111 +04000100 22222222 +0A000110 00003333 +02000110 00004444 +08000120 00000055 +00000120 00000066 +08000130 40F66666 +00000130 410CCCCD +04000200 80000204 +04000210 81000000 +04000220 82000000 +04000300 11111111 +02000310 00002222 +00000320 00000033 +00000330 408CCCCD +04000340 60000000 \ No newline at end of file diff --git a/tests/writes_asm/expected/output-code.bin b/tests/writes_asm/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 GIT binary patch literal 4 LcmZQzU|;|M00aO5 literal 0 HcmV?d00001 diff --git a/tests/writes_asm/expected/output-dolphin.ini b/tests/writes_asm/expected/output-dolphin.ini new file mode 100644 index 0000000..faf780c --- /dev/null +++ b/tests/writes_asm/expected/output-dolphin.ini @@ -0,0 +1,19 @@ +0x82000000:dword:0x00000000 +0x80000000:dword:0x80000008 +0x80000010:dword:0x81000000 +0x80000020:dword:0x82000000 +0x80000030:dword:0x80000038 +0x80000040:dword:0x81000000 +0x80000050:dword:0x82000000 +0x80000100:dword:0x22222222 +0x80000110:word:0x00004444 +0x80000120:byte:0x00000066 +0x80000130:byte:0x000000410CCCCD +0x80000200:dword:0x80000204 +0x80000210:dword:0x81000000 +0x80000220:dword:0x82000000 +0x80000300:dword:0x11111111 +0x80000310:word:0x00002222 +0x80000320:byte:0x00000033 +0x80000330:byte:0x000000408CCCCD +0x80000340:dword:0x60000000 \ No newline at end of file diff --git a/tests/writes_asm/expected/output-gecko.txt b/tests/writes_asm/expected/output-gecko.txt new file mode 100644 index 0000000..8f993d9 --- /dev/null +++ b/tests/writes_asm/expected/output-gecko.txt @@ -0,0 +1,44 @@ +06000000 00000008 +00000000 00000000 +20000000 80000004 +04000000 80000008 +E2000001 00000000 +20000010 80000014 +04000010 81000000 +E2000001 00000000 +20000020 80000024 +04000020 82000000 +E2000001 00000000 +20000030 81000000 +04000030 80000038 +E2000001 00000000 +20000040 81000000 +04000040 81000000 +E2000001 00000000 +20000050 81000000 +04000050 82000000 +E2000001 00000000 +20000100 11111111 +04000100 22222222 +E2000001 00000000 +28000110 00003333 +02000110 00004444 +E2000001 00000000 +C0000000 00000004 +3C608000 60630120 +88030000 2C000055 +4082000C 38000066 +98030000 4E800020 +C0000000 00000004 +3C608000 60630130 +88030000 6CF66666 +4082000C 790CCCCD +98030000 4E800020 +04000200 80000204 +04000210 81000000 +04000220 82000000 +04000300 11111111 +02000310 00002222 +00000320 00000033 +00000330 408CCCCD +04000340 60000000 \ No newline at end of file diff --git a/tests/writes_asm/expected/output-kamek.Base.bin b/tests/writes_asm/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..03cf984d1cc2ef58acffdc377309b0971a1b5b17 GIT binary patch literal 292 zcmYk0u@1s83`DOX0|P^m_<#U~IZ_tJAa!G5VTXY(h<|{cPiudNk#dfWgr!sNITt&J z%l&!-9JD--pR5I}$MN$ZQB%qr*H7&&i~~_Jjd7&kNya#f|KlUEa8u@2Sh41;jdBgN zEs)YyIWXQ)C*!!E^+SGlT~+QKcRO#s{LQ?)LnxUEWd2e;=X0TY$t3eJzxu)Q`OJ$i Dij`Ge literal 0 HcmV?d00001 diff --git a/tests/writes_asm/expected/output-kamek.V2.bin b/tests/writes_asm/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..16b1d9c2245ad2f1590b2831e5a030fc520dafc2 GIT binary patch literal 292 zcmYk0p$-Bu5Jcxn1p-kLKA^yXZc>9R$vF%L4}u!PKY-`c?tTZ!G21Q)n@l=yJKgQ! za=+dHgIboyPuc?3~@qc`jyl`9QH(0UetW9MH zbR7`mwz6kDQzzxHpY=m}=iHQg!`;TJFMm@n@8C;j0-3+8p7Xh|ddWofA-(!R^Xbfs EFUnO_y#N3J literal 0 HcmV?d00001 diff --git a/tests/writes_asm/expected/output-map-dynamic.map b/tests/writes_asm/expected/output-map-dynamic.map new file mode 100644 index 0000000..e9d7ae6 --- /dev/null +++ b/tests/writes_asm/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000004 000000 __ctor_loc + 00000004 000000 __ctor_end + 00000004 000000 _e_text + 00000004 000000 _f_ctors + 00000004 000000 _e_ctors + 00000004 000000 _f_dtors + 00000004 000000 _e_dtors + 00000004 000000 _f_rodata + 00000004 000000 _e_rodata + 00000004 000000 _f_data + 00000004 000000 _e_data diff --git a/tests/writes_asm/expected/output-map-static.map b/tests/writes_asm/expected/output-map-static.map new file mode 100644 index 0000000..bf756ba --- /dev/null +++ b/tests/writes_asm/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000004 000000 __ctor_loc + 82000004 000000 __ctor_end + 82000004 000000 _e_text + 82000004 000000 _f_ctors + 82000004 000000 _e_ctors + 82000004 000000 _f_dtors + 82000004 000000 _e_dtors + 82000004 000000 _f_rodata + 82000004 000000 _e_rodata + 82000004 000000 _f_data + 82000004 000000 _e_data diff --git a/tests/writes_asm/expected/output-riiv.xml b/tests/writes_asm/expected/output-riiv.xml new file mode 100644 index 0000000..e597392 --- /dev/null +++ b/tests/writes_asm/expected/output-riiv.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/writes_asm/externals.txt b/tests/writes_asm/externals.txt new file mode 100644 index 0000000..f1fe089 --- /dev/null +++ b/tests/writes_asm/externals.txt @@ -0,0 +1 @@ +externalSym=0x81000000 diff --git a/tests/writes_asm/test.S b/tests/writes_asm/test.S new file mode 100644 index 0000000..32a2bdd --- /dev/null +++ b/tests/writes_asm/test.S @@ -0,0 +1,26 @@ +#include + +.extern externalSym +localSym: .long 0 + +kmCondWritePointer 0x80000000, 0x80000004, 0x80000008 +kmCondWritePointer 0x80000010, 0x80000014, externalSym +kmCondWritePointer 0x80000020, 0x80000024, localSym +kmCondWritePointer 0x80000030, externalSym, 0x80000038 +kmCondWritePointer 0x80000040, externalSym, externalSym +kmCondWritePointer 0x80000050, externalSym, localSym + +kmCondWrite32 0x80000100, 0x11111111, 0x22222222 +kmCondWrite16 0x80000110, 0x3333, 0x4444 +kmCondWrite8 0x80000120, 0x55, 0x66 +kmCondWriteFloat 0x80000130, 7.7, 8.8 + +kmWritePointer 0x80000200, 0x80000204 +kmWritePointer 0x80000210, externalSym +kmWritePointer 0x80000220, localSym + +kmWrite32 0x80000300, 0x11111111 +kmWrite16 0x80000310, 0x2222 +kmWrite8 0x80000320, 0x33 +kmWriteFloat 0x80000330, 4.4 +kmWriteNop 0x80000340 diff --git a/tests/writes_cpp/expected/output-ar.txt b/tests/writes_cpp/expected/output-ar.txt new file mode 100644 index 0000000..c17c2d6 --- /dev/null +++ b/tests/writes_cpp/expected/output-ar.txt @@ -0,0 +1,28 @@ +0C000000 80000004 +04000000 80000008 +0C000010 80000014 +04000010 81000000 +0C000020 80000024 +04000020 82000000 +0C000030 81000000 +04000030 80000038 +0C000040 81000000 +04000040 81000000 +0C000050 81000000 +04000050 82000000 +0C000100 11111111 +04000100 22222222 +0A000110 00003333 +02000110 00004444 +08000120 00000055 +00000120 00000066 +0C000130 40F66666 +04000130 410CCCCD +04000200 80000204 +04000210 81000000 +04000220 82000000 +04000300 11111111 +02000310 00002222 +00000320 00000033 +04000330 408CCCCD +04000340 60000000 \ No newline at end of file diff --git a/tests/writes_cpp/expected/output-code.bin b/tests/writes_cpp/expected/output-code.bin new file mode 100644 index 0000000..e69de29 diff --git a/tests/writes_cpp/expected/output-dolphin.ini b/tests/writes_cpp/expected/output-dolphin.ini new file mode 100644 index 0000000..089308a --- /dev/null +++ b/tests/writes_cpp/expected/output-dolphin.ini @@ -0,0 +1,18 @@ +0x80000000:dword:0x80000008 +0x80000010:dword:0x81000000 +0x80000020:dword:0x82000000 +0x80000030:dword:0x80000038 +0x80000040:dword:0x81000000 +0x80000050:dword:0x82000000 +0x80000100:dword:0x22222222 +0x80000110:word:0x00004444 +0x80000120:byte:0x00000066 +0x80000130:dword:0x410CCCCD +0x80000200:dword:0x80000204 +0x80000210:dword:0x81000000 +0x80000220:dword:0x82000000 +0x80000300:dword:0x11111111 +0x80000310:word:0x00002222 +0x80000320:byte:0x00000033 +0x80000330:dword:0x408CCCCD +0x80000340:dword:0x60000000 \ No newline at end of file diff --git a/tests/writes_cpp/expected/output-gecko.txt b/tests/writes_cpp/expected/output-gecko.txt new file mode 100644 index 0000000..6e46277 --- /dev/null +++ b/tests/writes_cpp/expected/output-gecko.txt @@ -0,0 +1,40 @@ +20000000 80000004 +04000000 80000008 +E2000001 00000000 +20000010 80000014 +04000010 81000000 +E2000001 00000000 +20000020 80000024 +04000020 82000000 +E2000001 00000000 +20000030 81000000 +04000030 80000038 +E2000001 00000000 +20000040 81000000 +04000040 81000000 +E2000001 00000000 +20000050 81000000 +04000050 82000000 +E2000001 00000000 +20000100 11111111 +04000100 22222222 +E2000001 00000000 +28000110 00003333 +02000110 00004444 +E2000001 00000000 +C0000000 00000004 +3C608000 60630120 +88030000 2C000055 +4082000C 38000066 +98030000 4E800020 +20000130 40F66666 +04000130 410CCCCD +E2000001 00000000 +04000200 80000204 +04000210 81000000 +04000220 82000000 +04000300 11111111 +02000310 00002222 +00000320 00000033 +04000330 408CCCCD +04000340 60000000 \ No newline at end of file diff --git a/tests/writes_cpp/expected/output-kamek.Base.bin b/tests/writes_cpp/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..ad7b3b73cf3fa66dcfe721f548c7cdb0ef2f10ca GIT binary patch literal 288 zcmeZH%uUT^U|?ckU|<1a450k~|Gx&HC=hc1F$}e=s9y1%63QqN&o

9R$vF%L4}u!PKY-`c?tTZ!G25;nVUkVe?M`=l zxZJNdzyPqUKdr~{^I(@XWm#qSgp=Mv*@Ggt%7K0-8RaDYhmVpMZp;1#D{4+{Dm$R- zfEc%xJ>!{m(tOy@`XRk@Zpz&7wz2BV-_*-H_>!4G_AjgFejcn|GEp-jz4}3YI&<&^ DxgAxp literal 0 HcmV?d00001 diff --git a/tests/writes_cpp/expected/output-map-dynamic.map b/tests/writes_cpp/expected/output-map-dynamic.map new file mode 100644 index 0000000..dd8b8d4 --- /dev/null +++ b/tests/writes_cpp/expected/output-map-dynamic.map @@ -0,0 +1,17 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 __ctor_loc + 00000000 000000 __ctor_end + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000000 000000 _e_text + 00000000 000000 _f_ctors + 00000000 000000 _e_ctors + 00000000 000000 _f_dtors + 00000000 000000 _e_dtors + 00000000 000000 _f_rodata + 00000000 000000 _e_rodata + 00000000 000000 _f_data + 00000000 000000 _e_data + 00000000 000004 localSym diff --git a/tests/writes_cpp/expected/output-map-static.map b/tests/writes_cpp/expected/output-map-static.map new file mode 100644 index 0000000..b030be5 --- /dev/null +++ b/tests/writes_cpp/expected/output-map-static.map @@ -0,0 +1,17 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 __ctor_loc + 82000000 000000 __ctor_end + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000000 000000 _e_text + 82000000 000000 _f_ctors + 82000000 000000 _e_ctors + 82000000 000000 _f_dtors + 82000000 000000 _e_dtors + 82000000 000000 _f_rodata + 82000000 000000 _e_rodata + 82000000 000000 _f_data + 82000000 000000 _e_data + 82000000 000004 localSym diff --git a/tests/writes_cpp/expected/output-riiv.xml b/tests/writes_cpp/expected/output-riiv.xml new file mode 100644 index 0000000..e5307e0 --- /dev/null +++ b/tests/writes_cpp/expected/output-riiv.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/writes_cpp/externals.txt b/tests/writes_cpp/externals.txt new file mode 100644 index 0000000..f1fe089 --- /dev/null +++ b/tests/writes_cpp/externals.txt @@ -0,0 +1 @@ +externalSym=0x81000000 diff --git a/tests/writes_cpp/test.cpp b/tests/writes_cpp/test.cpp new file mode 100644 index 0000000..044fb13 --- /dev/null +++ b/tests/writes_cpp/test.cpp @@ -0,0 +1,26 @@ +#include + +extern int externalSym; +int localSym; + +kmCondWritePointer(0x80000000, 0x80000004, 0x80000008); +kmCondWritePointer(0x80000010, 0x80000014, &externalSym); +kmCondWritePointer(0x80000020, 0x80000024, &localSym); +kmCondWritePointer(0x80000030, &externalSym, 0x80000038); +kmCondWritePointer(0x80000040, &externalSym, &externalSym); +kmCondWritePointer(0x80000050, &externalSym, &localSym); + +kmCondWrite32(0x80000100, 0x11111111, 0x22222222); +kmCondWrite16(0x80000110, 0x3333, 0x4444); +kmCondWrite8(0x80000120, 0x55, 0x66); +kmCondWriteFloat(0x80000130, 7.7f, 8.8f); + +kmWritePointer(0x80000200, 0x80000204); +kmWritePointer(0x80000210, &externalSym); +kmWritePointer(0x80000220, &localSym); + +kmWrite32(0x80000300, 0x11111111); +kmWrite16(0x80000310, 0x2222); +kmWrite8(0x80000320, 0x33); +kmWriteFloat(0x80000330, 4.4f); +kmWriteNop(0x80000340); From 3b229896b0f19f8f1c6c8237b65363cec14af592 Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Thu, 26 Feb 2026 20:36:28 -0500 Subject: [PATCH 02/12] Add static dol and alf patching to test suite --- .../expected/output-alf_104.alf | Bin 0 -> 33080 bytes .../expected/output-alf_105.alf | Bin 0 -> 33088 bytes .../expected/output-alf_104.alf | Bin 0 -> 33080 bytes .../expected/output-alf_105.alf | Bin 0 -> 33088 bytes .../expected/output-alf_104.alf | Bin 0 -> 33020 bytes .../expected/output-alf_105.alf | Bin 0 -> 33028 bytes .../kmBranch_asm/expected/output-alf_104.alf | Bin 0 -> 33008 bytes .../kmBranch_asm/expected/output-alf_105.alf | Bin 0 -> 33016 bytes .../kmBranch_cpp/expected/output-alf_104.alf | Bin 0 -> 33004 bytes .../kmBranch_cpp/expected/output-alf_105.alf | Bin 0 -> 33012 bytes .../expected/output-alf_104.alf | Bin 0 -> 33020 bytes .../expected/output-alf_105.alf | Bin 0 -> 33028 bytes .../expected/output-alf_104.alf | Bin 0 -> 33020 bytes .../expected/output-alf_105.alf | Bin 0 -> 33028 bytes .../kmCallDef_asm/expected/output-alf_104.alf | Bin 0 -> 33020 bytes .../kmCallDef_asm/expected/output-alf_105.alf | Bin 0 -> 33028 bytes tests/kmCall_asm/expected/output-alf_104.alf | Bin 0 -> 33008 bytes tests/kmCall_asm/expected/output-alf_105.alf | Bin 0 -> 33016 bytes tests/kmCall_cpp/expected/output-alf_104.alf | Bin 0 -> 33004 bytes tests/kmCall_cpp/expected/output-alf_105.alf | Bin 0 -> 33012 bytes .../expected/output-alf_104.alf | Bin 0 -> 33032 bytes .../expected/output-alf_105.alf | Bin 0 -> 33040 bytes tests/make_sample_dol_alf.py | 124 ++++++++++++++++++ tests/run_tests.py | 13 ++ tests/sample.dol | Bin 0 -> 33024 bytes tests/sample_104.alf | Bin 0 -> 32992 bytes tests/sample_105.alf | Bin 0 -> 33000 bytes tests/writes_asm/expected/output-alf_104.alf | Bin 0 -> 33008 bytes tests/writes_asm/expected/output-alf_105.alf | Bin 0 -> 33016 bytes tests/writes_cpp/expected/output-alf_104.alf | Bin 0 -> 33004 bytes tests/writes_cpp/expected/output-alf_105.alf | Bin 0 -> 33012 bytes 31 files changed, 137 insertions(+) create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-alf_104.alf create mode 100644 tests/kmBranchDefAsm_cpp/expected/output-alf_105.alf create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-alf_104.alf create mode 100644 tests/kmBranchDefCpp_cpp/expected/output-alf_105.alf create mode 100644 tests/kmBranchDef_asm/expected/output-alf_104.alf create mode 100644 tests/kmBranchDef_asm/expected/output-alf_105.alf create mode 100644 tests/kmBranch_asm/expected/output-alf_104.alf create mode 100644 tests/kmBranch_asm/expected/output-alf_105.alf create mode 100644 tests/kmBranch_cpp/expected/output-alf_104.alf create mode 100644 tests/kmBranch_cpp/expected/output-alf_105.alf create mode 100644 tests/kmCallDefAsm_cpp/expected/output-alf_104.alf create mode 100644 tests/kmCallDefAsm_cpp/expected/output-alf_105.alf create mode 100644 tests/kmCallDefCpp_cpp/expected/output-alf_104.alf create mode 100644 tests/kmCallDefCpp_cpp/expected/output-alf_105.alf create mode 100644 tests/kmCallDef_asm/expected/output-alf_104.alf create mode 100644 tests/kmCallDef_asm/expected/output-alf_105.alf create mode 100644 tests/kmCall_asm/expected/output-alf_104.alf create mode 100644 tests/kmCall_asm/expected/output-alf_105.alf create mode 100644 tests/kmCall_cpp/expected/output-alf_104.alf create mode 100644 tests/kmCall_cpp/expected/output-alf_105.alf create mode 100644 tests/kmPatchExitPoint/expected/output-alf_104.alf create mode 100644 tests/kmPatchExitPoint/expected/output-alf_105.alf create mode 100644 tests/make_sample_dol_alf.py create mode 100644 tests/sample.dol create mode 100644 tests/sample_104.alf create mode 100644 tests/sample_105.alf create mode 100644 tests/writes_asm/expected/output-alf_104.alf create mode 100644 tests/writes_asm/expected/output-alf_105.alf create mode 100644 tests/writes_cpp/expected/output-alf_104.alf create mode 100644 tests/writes_cpp/expected/output-alf_105.alf diff --git a/tests/kmBranchDefAsm_cpp/expected/output-alf_104.alf b/tests/kmBranchDefAsm_cpp/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..252369a4c2565b18ebe6e97e03ca7304a87d5a78 GIT binary patch literal 33080 zcmeI)Jx&5a6ae7y2PJC35jcP`h>fMOFhZe;Cy)f9g<4TquAI?BSXx-v;TwL!vZYbM zKA@Ci#0Me=FzO1PBly zK!5-N0t5&UAV7e?KM-i7V!jq|G#oq+kN?4(O_2Zr0t5&UAV7cs0RjXF5cs}8v$Ph_ z?+tsUeF5Kps5=P|AV7cs0RjXF5FkK+0D-j?XjRq%>QQ&i1pkb<t+X*=p|)Xk{*fPu%} m)7`_Mf4mp%{$QR(Qsj}jY(y=MY%h&$r{;8I9#zZ3XXOhUeMQp% literal 0 HcmV?d00001 diff --git a/tests/kmBranchDefAsm_cpp/expected/output-alf_105.alf b/tests/kmBranchDefAsm_cpp/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..ee078e872bdb0b1ef7bd1424404b5d75af3ad727 GIT binary patch literal 33088 zcmeI)Jx&5a6ae5s@h57*5jcP`h>fMOFiN3`Cy)f9CTc}txpGDiVQFDuhi^c_vZYah z_1=ts`xNqUj1PBlyK!5-N0t5&UAVA=M1coQ^o?MP^ zQmr$IYn{>PBl7k0l=dUmFN@TSxDo9+ZbtiS#I0!Gi@2TJ;~B#kp6XHVqO3*92Mj!R npKc%ey~CZT_xjT;k|OuaS8Wo?z1wrW+o?I}oqKMSM&yBCuy;k> literal 0 HcmV?d00001 diff --git a/tests/kmBranchDefCpp_cpp/expected/output-alf_104.alf b/tests/kmBranchDefCpp_cpp/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..252369a4c2565b18ebe6e97e03ca7304a87d5a78 GIT binary patch literal 33080 zcmeI)Jx&5a6ae7y2PJC35jcP`h>fMOFhZe;Cy)f9g<4TquAI?BSXx-v;TwL!vZYbM zKA@Ci#0Me=FzO1PBly zK!5-N0t5&UAV7e?KM-i7V!jq|G#oq+kN?4(O_2Zr0t5&UAV7cs0RjXF5cs}8v$Ph_ z?+tsUeF5Kps5=P|AV7cs0RjXF5FkK+0D-j?XjRq%>QQ&i1pkb<t+X*=p|)Xk{*fPu%} m)7`_Mf4mp%{$QR(Qsj}jY(y=MY%h&$r{;8I9#zZ3XXOhUeMQp% literal 0 HcmV?d00001 diff --git a/tests/kmBranchDefCpp_cpp/expected/output-alf_105.alf b/tests/kmBranchDefCpp_cpp/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..ee078e872bdb0b1ef7bd1424404b5d75af3ad727 GIT binary patch literal 33088 zcmeI)Jx&5a6ae5s@h57*5jcP`h>fMOFiN3`Cy)f9CTc}txpGDiVQFDuhi^c_vZYah z_1=ts`xNqUj1PBlyK!5-N0t5&UAVA=M1coQ^o?MP^ zQmr$IYn{>PBl7k0l=dUmFN@TSxDo9+ZbtiS#I0!Gi@2TJ;~B#kp6XHVqO3*92Mj!R npKc%ey~CZT_xjT;k|OuaS8Wo?z1wrW+o?I}oqKMSM&yBCuy;k> literal 0 HcmV?d00001 diff --git a/tests/kmBranchDef_asm/expected/output-alf_104.alf b/tests/kmBranchDef_asm/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..97108bec6f034a6d3d2f8aa13efef76f28cc6b27 GIT binary patch literal 33020 zcmeI*F;2rU6aY}S0;%ehBjf}q4GS{^5)2@5f<{UN12AP^44jvU+lpj>S4h2rrQQHl&OH z+SMnMdAxqOd5yVE``;K4q+t45O>AD}5yL2<1r6IS?F|1d&|5mq={=Xov&MVJXPvi%G0CC1D AEdT%j literal 0 HcmV?d00001 diff --git a/tests/kmBranch_asm/expected/output-alf_104.alf b/tests/kmBranch_asm/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..0c2dc11edee9b2aecb5c3ffacbee4ff07224e5e0 GIT binary patch literal 33008 zcmeI)K~BOz6adiCU}9Kt1QxCh;0;_D3=0!aAPJ2w)KwQOt0(jb9>E*bU$CL=iZm{0 z@+SFZru|HY*WJ%BkGBtZFKO3`@!w~fL?>dI(kP$pZ&uf3S^gYGDczUlcXO;yfB*pk z1PBlyK!5-N0t5&QP+*dZx)yMqXWM)}z~5lW1PBlyK!5-N0t5&UAV7e?@dDFEEnu_G z*NuGv$4?@Y009C72oNAZfB*pk1PBlqjKHi@3$QO>Ft5%+2@oJafB*pk1PBlyK!89m zfg)-FRg3ciqJ6afFR<9%+g(;ET^&X#tvY81#MuI0&FA_A2oNAZfB*pk1PBlyK!Csi z1SXwYz|8>GY>5O25FkK+009C72oNAZfIxqNX`>cUogL8F7tnuF-y}eQ009C72oNAZ zfB*pk1Ws09)~N;97jUw#%EAZ`AV7cs0RjXF5FkK+z&{Cmj$)!Js`eCd9&s7*wtjzp g%{KFK^fy^Oia}9lpS3d=t;|K5?lY^bi-@}Y0#w#DHvj+t literal 0 HcmV?d00001 diff --git a/tests/kmBranch_asm/expected/output-alf_105.alf b/tests/kmBranch_asm/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..d5fbf48efa30f516dfd8ed4f16d8cc240d02f987 GIT binary patch literal 33016 zcmeI)F-ikL6adgsB8XLvkiuG$cmoTGq!7G8AVCGS+QM@6gdV{oc!Tv%;*!Z$Ay{PL z4a{c#=Fc*D+kGbUaC3kAoYt+r`1?%57(}0?G^oa#oB29xnxAcy(p}Shm$5Mc0t5&U zAV7cs0RjXF5FpS)fnloKTEJDcdaouu{0){&fB*pk1PBlyK!5-N0t5)`FEA=<0n0_T zDE0;H{}7o32oNAZfB*pk1PBlyK!8AR1je0OfPDeId36>_fB*pk1PBlyK!5-N0t5~c zsG}B;TbvgV?PKTv0@L-q^<|#Y zFznOz>% literal 0 HcmV?d00001 diff --git a/tests/kmBranch_cpp/expected/output-alf_104.alf b/tests/kmBranch_cpp/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..e05feefd968ee354782ac8397e7ef5d05f76d8bb GIT binary patch literal 33004 zcmeI)Jx&5a6ae7SU}C5^0)@2!yn%(mP?&fENg!IN)fSekC-ev&!5ge^_zA;Sgjlf2 zH_2OOb{~`B+wNtU$J>Xym$YhifAg6J(TSL*)T>78oB29zn%~_hrTeD&DaZN*2oNAZ zfB*pk1PBlyK!8981qP|!)&j1p5g4^<0rmxS=G9p!0RjXF5FkK+009C72oN|* zppIHVZgE~fw9mc&3rtq`R+m{ySG!S4v)0)GakjvB`COj>0RjXF5FkK+009C72oUIi zz@SwNxaq)}Es+2L0t5&UAV7cs0RjXF5IA07SkwaY*#X7Afa53iO#%c65FkK+009C7 z2oNAZ;A90xty+M60Vn&aEQ|mF0t5&UAV7cs0RjXF{FA^}o~IY_6mcGL8SyrMe|}vq h#{K9omfKMb>YSO|SwxXJ*~^@y;W{&CUF7sl`vbf0H8TJJ literal 0 HcmV?d00001 diff --git a/tests/kmBranch_cpp/expected/output-alf_105.alf b/tests/kmBranch_cpp/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..27470b44a4e49193cd8f107ec5450e441baff6db GIT binary patch literal 33012 zcmeI)!Aiq07y#fX6J)17LJyv0n{VJjCOZhe!JtJ2_0+?T)hF~3d<5U1CaYsvPh)sk z;R~cq+CL%tdi%-pc>8eo5;mn7|J}nRHey|bFsi5B!*pG=?a!_k!hPF*=Y4Gg1PBly zK!5-N0t5&UAV6S%0+Y~ea{L8-fO1u@ zvV8%EPa={40RjXF5FkK+009C72oM;Iz_gbOurFXRpUy%F5FkK+009C72oNAZfWT1# zP0R(P63+{Wufd12AP^44jK0g^ z)B@}asQY=#jsO7y1PBlyK!5-N0t5(*SqmtwoEZ@DHGeN~A8|Qsr#T$~0t5&UAV7cs z0RjXF5Fk*iK=W4%n9dHkt~F745g0OWmnoF<7nmf-^y*|zYEIBvg$lzZa;h#DkT5_ literal 0 HcmV?d00001 diff --git a/tests/kmCallDefAsm_cpp/expected/output-alf_105.alf b/tests/kmCallDefAsm_cpp/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..daa51eb72252c26750b407a6128194aec1d1ab90 GIT binary patch literal 33028 zcmeI*K}y6h6adiQK|yCVN9YNpQ#Y<%2)a=41QuFUP*+{Jte)JYW3kQ=!V4s6L$dg< zU47E@@%rKBHRdvHfBV>_i&XC-s8$GYAkMK!5-N0t5&UAV7dX*#gZ` zF2KHkvY)r;2oNAZfB*pk1PBlyK!CuMasj#IGXo;NmhS~_BhJTm9@7vYK!5-N0t5&U zAV7cs0Rp88?EZ2A^VtEHr3NZ40t5&UAV7cs0RjXF5FkKc7N}RbfP8jM5%GDeBa3 za{rRXHmRPa`rds!zYYCHh_JcAj~ufd12AP^44jK0g^ z)B@}asQY=#jsO7y1PBlyK!5-N0t5(*SqmtwoEZ@DHGeN~A8|Qsr#T$~0t5&UAV7cs z0RjXF5Fk*iK=W4%n9dHkt~F745g0OWmnoF<7nmf-^y*|zYEIBvg$lzZa;h#DkT5_ literal 0 HcmV?d00001 diff --git a/tests/kmCallDefCpp_cpp/expected/output-alf_105.alf b/tests/kmCallDefCpp_cpp/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..daa51eb72252c26750b407a6128194aec1d1ab90 GIT binary patch literal 33028 zcmeI*K}y6h6adiQK|yCVN9YNpQ#Y<%2)a=41QuFUP*+{Jte)JYW3kQ=!V4s6L$dg< zU47E@@%rKBHRdvHfBV>_i&XC-s8$GYAkMK!5-N0t5&UAV7dX*#gZ` zF2KHkvY)r;2oNAZfB*pk1PBlyK!CuMasj#IGXo;NmhS~_BhJTm9@7vYK!5-N0t5&U zAV7cs0Rp88?EZ2A^VtEHr3NZ40t5&UAV7cs0RjXF5FkKc7N}RbfP8jM5%GDeBa3 za{rRXHmRPa`rds!zYYCHh_JcAj~ufd12AP^44jK0g^ z)B@}asQY=#jsO7y1PBlyK!5-N0t5(*SqmtwoEZ@DHGeN~A8|Qsr#T$~0t5&UAV7cs z0RjXF5Fk*iK=W4%n9dHkt~F745g0OWmnoF<7nmf-^y*|zYEIBvg$lzZa;h#DkT5_ literal 0 HcmV?d00001 diff --git a/tests/kmCallDef_asm/expected/output-alf_105.alf b/tests/kmCallDef_asm/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..daa51eb72252c26750b407a6128194aec1d1ab90 GIT binary patch literal 33028 zcmeI*K}y6h6adiQK|yCVN9YNpQ#Y<%2)a=41QuFUP*+{Jte)JYW3kQ=!V4s6L$dg< zU47E@@%rKBHRdvHfBV>_i&XC-s8$GYAkMK!5-N0t5&UAV7dX*#gZ` zF2KHkvY)r;2oNAZfB*pk1PBlyK!CuMasj#IGXo;NmhS~_BhJTm9@7vYK!5-N0t5&U zAV7cs0Rp88?EZ2A^VtEHr3NZ40t5&UAV7cs0RjXF5FkKc7N}RbfP8jM5%GDeBa3 za{rRXHmRPa`rds!zYYCHh_JcAj~v?0zQ0+wNzW$J>Xym)N#)`1cv3)JZXq7!;G;&3v6#)z5wuabH#6&9OcK0t5&U zAV7cs0RjXF5FpS)fl-uoE#SIXZ;ELTe}g3xAV7cs0RjXF5FkK+009EW3yd4JfYq{C zHueP^KZ#5N1PBlyK!5-N0t5&UAV8ou0+UuPz`lUqygCadK!5-N0t5&UAV7cs0Ro)_ z%2W%;EuR?>@p15ff!X%n_Ogh$+K(a@t+NBt*#ck9=lTQ)5FkK+009C72oNAZfItrf zMy*=FO%K*=i3A7`AV7cs0RjXF5FkK+KzD(0qZW|Q4ruHP=su}$5+Fc;009C72oNAZ zfB*pkCo3>%)dK7bIN4WaVFU;eAV7cs0RjXF5FkL{p9DTH(nL9OdrEPh;xfhC^8NXB fy_ybFf3>bhX;9YLXNQ@ygUnfscbPeBkfLtCn3gp? literal 0 HcmV?d00001 diff --git a/tests/kmCall_asm/expected/output-alf_105.alf b/tests/kmCall_asm/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..b903d126ef2842f627237b6e0ff61094cba630ec GIT binary patch literal 33016 zcmeI)F-ikL6adh#7!a!*A&sph@dg$WNg;THK!OTtwT0#C4LyQK@C55j;*!Z$Ay{PL z4a{c#=Fc*D+kGbUaC3kA9P3tJ{C&nS4N{*)465mv=4Ts4+%?U285>7Z|D&`f+tvK_zA;Sgjlf2 zH_2OOb{~`B+wNtU$J>XymsqvBzxj+o>ZF)P^s3SNX1-3F=65%WxNn-Da;#5)009C7 z2oNAZfB*pk1PF9cU=a1T7I0lHKdNyDe}g3xAV7cs0RjXF5FkK+009Dr3k-`|z+zs_ zi+uryPa=~50RjXF5FkK+009C72oUIuz^GLVurHu9ug*dV5FkK+009C72oNAZfWT1# zb*csAmd^}`_}u%yz+`oAb(uw6?M4x^*4Y8+Y=Q6cxjq2`1PBlyK!5-N0t5&UAkYDU zL8}&U(}6WxA^`#f2oNAZfB*pk1PBlyaJ;~YSO|S&AZavX?oD;W{&C^>X^A{Q>`%H8}tP literal 0 HcmV?d00001 diff --git a/tests/kmCall_cpp/expected/output-alf_105.alf b/tests/kmCall_cpp/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..951f584d3e99b68888c2184d5e045ad90f804b4b GIT binary patch literal 33012 zcmeI)K~4fO6adh#k;Jg#2yEOMz#F(Q7#1epfCQo@>S`7&M{np6Jc1_}TaZv@MTiR~ zc}+Ug&ippz&F-i4@%G{FCDx_x|J`Gd8mUerdevz2Fkh!l^Rw$k+&9g4+1DmOfB*pk z1PBlyK!5-N0t7lJFo=4a3%IV9t7_cA-(blE2oNAZfB*pk1PBlyK!CvE0>dH~u$Wi# zVqd`FlZYfhfB*pk1PBlyK!5-N0t7lEFlyxj>zKKA}EFj+raUuF?kyI#bsb#_2HTi~mFuT6je0RjXF5FkK+009C72y{ST z(8>kebYRVvNPqwV0t5&UAV7cs0RjXF94{~|asm15fMQ?3@sk=!fB*pk1PBlyK!5-N z0t5)0tiY(13$QQXWIvUK5gUpY{slLtMpI(=X iaX+;e%WW@p>KvKN+2&S8PxhiGG2BGw$X+ob5BvoWgf&9| literal 0 HcmV?d00001 diff --git a/tests/kmPatchExitPoint/expected/output-alf_104.alf b/tests/kmPatchExitPoint/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..daff94efa4f723fde048e17ec7905c754f44b4ba GIT binary patch literal 33032 zcmeI)O-jTt6ae5T3WIKXgq}b;^#(3PTqt+~3oW`(S6#S_b8cZw+7a3wA$)^yq zQ1*JOjsO7y1PBlyK!5-N0t5)e)CIOs*731Ikzw-twP%)gfH;=6J8hZ zYgdmnFL%%P?_nD8`tKa7bdlm_91deMPdXAHK!5-N0t5&UAV7cs0Rn{zR3WZ<0sBJh zR2BgO1PBlyK!5-N0t5&UATSHmi(WwAjh%G?z6=5c2oNAZfB*pk1PBlyP_{s`=>=F9 zQ1<&)9RUIa2oNAZfB*pk1PBm_sTYt(-ZLPC@74bT?KI~=fB*pk1PBlyK!5-N0t5(@ zDo|~D0k@?VsxATq2oNAZfB*pk1PBlyKwuK67rlVIcYt*PJ`4f`2oNAZfB*pk1PBly zP_{s`=>=F9Q1<&)9RUIa2oNAZfB*pk1PBla;h47#$nlutbozM+VfPe6o#u`i=pw~i tit`k^6rbJK>&MXVuhMlt{NJUUm^1S@n@`K^c9q?Rdd|+7my0LzgTG-dF600J literal 0 HcmV?d00001 diff --git a/tests/make_sample_dol_alf.py b/tests/make_sample_dol_alf.py new file mode 100644 index 0000000..4896e52 --- /dev/null +++ b/tests/make_sample_dol_alf.py @@ -0,0 +1,124 @@ +import dataclasses +from pathlib import Path +import struct + + +@dataclasses.dataclass +class Section: + addr: int + data: bytes + is_bss: bool = False + +@dataclasses.dataclass +class Symbol: + mangled_name: bytes + demangled_name: bytes + addr: int + size: int + is_data: bool + section_id: int + unk_10: int + +def pad(data: bytes, size: int) -> bytes: + return data + b'\0' * (size - len(data)) + + +text_sections = [ + Section(0x80000000, pad(b'.text0', 0x1000)), + Section(0x80001000, pad(b'.text1', 0x1000)), + Section(0x81000000, pad(b'.text2', 0x1000)), + Section(0x81001000, pad(b'.text3', 0x1000)), +] +data_sections = [ + Section(0x80002000, pad(b'.data0', 0x1000)), + Section(0x80003000, pad(b'.data1', 0x1000)), + Section(0x81002000, pad(b'.data2', 0x1000)), + Section(0x81003000, pad(b'.data3', 0x1000)), +] +symbols = [ + Symbol(b'mangled1', b'demangled1', 0x80000000, 4, False, 1, 0), + Symbol(b'mangled2', b'demangled2', 0x80002000, 4, True, 5, 1), +] +bss_section = Section(0x80008000, b'\0' * 0x1000, True) +entrypoint = 0x80000000 + + +def make_dol() -> bytes: + dol_data = bytearray(256) + + def write_header_u32(offs: int, value: int) -> None: + struct.pack_into('>I', dol_data, offs, value) + + write_header_u32(0xd8, bss_section.addr) + write_header_u32(0xdc, len(bss_section.data)) + write_header_u32(0xe0, entrypoint) + + for i, sec in enumerate(text_sections): + sec_offset = len(dol_data) + dol_data += sec.data + assert len(dol_data) % 4 == 0 + write_header_u32(0x00 + i * 4, sec_offset) + write_header_u32(0x48 + i * 4, sec.addr) + write_header_u32(0x90 + i * 4, len(sec.data)) + + for i, sec in enumerate(data_sections): + sec_offset = len(dol_data) + dol_data += sec.data + assert len(dol_data) % 4 == 0 + write_header_u32(0x1c + i * 4, sec_offset) + write_header_u32(0x64 + i * 4, sec.addr) + write_header_u32(0xac + i * 4, len(sec.data)) + + return dol_data + + +def make_alf(version: int) -> bytes: + alf_data = bytearray() + + def write_u32(value: int) -> None: + nonlocal alf_data + alf_data += struct.pack(' None: + struct.pack_into('vBNBL_QqZ6v3(Nh$3j z_7TU3vRz_ujTj;x<-$jQikT^G(;UY+j%Axt7i)dYcM*NL^rgRCTSj?GIluIOw<(^u z+-Ldy*ACO{y$Yy1_THYAV7cs0RjXF5FkK+Kw|>A{y#UClynFXAV7cs0RjXF5FkK+ z0D(&2a2v+K{{PCvfB*pk1PBlyK!5-N0t5)OCXnlY`~O>et@0s2fB*pk1PBlyK!5-N z0+m3n|Ly;;ObiGRAV7cs0RjXF5FkK+Kx+cI{i0t5&UAV7cs0RjXF5Fk(q Fya0LH85IBk literal 0 HcmV?d00001 diff --git a/tests/sample_104.alf b/tests/sample_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..a5968e440df93cd08ed9dbe5c8639ca991ee98ed GIT binary patch literal 32992 zcmeI*F>Zq}6aY}SYNfOjN5}~(LT=EZYo(r`NT6g$GBISNH}5xTB;W|{v-Ax{UjD<= zmoZ=OpC89GwejWenyR>ocpLibP~RTv2@oJafB*pk1PBlyK!5;&LItWcE@}b0Li3as z0RjXF5FkK+009C72oNA}6WGpb0bM(^_61lO1PBlyK!5-N0t5&UAV8pOfqGR7urHwO z_bodD1PBlyK!5-N0t5&UATUNPAh&#GKuSN0?**FanT`Mf0t5&UAV7cs0RjXF5GYlk zTGayfr6wvb0t5&UAV7cs0RjXF5FkKc64=ga0r~6z`vNQs0t5&UAV7cs0RjXF5Fk*t zK)tF3*cVXt`<5L60t5&UAV7cs0RjXF{Ck1#5O|E(M4a2p;na7#*SPQc`zQwEQ*^mK WM9gM3i literal 0 HcmV?d00001 diff --git a/tests/sample_105.alf b/tests/sample_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..b759b38fa69ca7ab2055ba03b5eb9d7980d4a46a GIT binary patch literal 33000 zcmeI*K~97)6adg_#zb9lggL>4!5g@6JBc?Sfs7{ViiJz&=KjK%07vM&CM~pS7yrTP zrrYdft9)|vRsOLc~0RjXF5FkK+009C72oNAps6ds*RW9IIXq>_# zK!5-N0t5&UAV7cs0RjYOf&C&E(6vKrUw}7*009C72oNAZfB*pk1PGKZP;YVp_63yv zyhTTV009C72oNAZfB*pk1jfh( YH(!>so7L^$>fu_7=016!gf-T(jq literal 0 HcmV?d00001 diff --git a/tests/writes_asm/expected/output-alf_104.alf b/tests/writes_asm/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..37553c383f263c60d917f1735e24ecbce2e47270 GIT binary patch literal 33008 zcmeI)F>b;z6aY{cQK@30H$WVq3UGrCT`TnjL;|%#+lirL;C{VRZD^##bA~8>mVU^O zEad;f^kw|^{QB|{uA^D}e}-keiScwg{+z1YL)Y>InlPJpt3G#=cz?jl^s zP|BNECjkNk2oNAZfB*pk1PGKXaGA&2Q>3wvF^lmKf| literal 0 HcmV?d00001 diff --git a/tests/writes_asm/expected/output-alf_105.alf b/tests/writes_asm/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..b97f6b997fb3c24c94a7dfd69a9c66734cb4ca8c GIT binary patch literal 33016 zcmeI)L23dq6adgvEEHGv2I2vV+8cDyZJ{TqptOayD;F+D@7Fu^M>~+o+Qs0!K*szb zBl&M!ePUjpUYeXB1PBlyK!5-N0t5*3R$!W%PAy>B+m%`v0RjXF5FkK+009C72oNA} z34vKr3)rl8Yx@E&q3Syb5FkK+009C72oNAZfIxo*7F8|4zJUI|D=Q;FfB*pk1PBly zK!5-N0+$eIq85-_J~JStL+AejtJ6If0t5&UAV7cs0RjXF5FkL{S_P(6EucOu?OOAe z7XbnU2oNAZfB*pk1PBlqs=%zM1>~~>>^wWqyp7&Ik)Qel7Vj+D literal 0 HcmV?d00001 diff --git a/tests/writes_cpp/expected/output-alf_104.alf b/tests/writes_cpp/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..c71e9bfc99139563c8b69be5984f8e19ddcc3e9a GIT binary patch literal 33004 zcmeI*F;2rU6aY|D6$y1JH>i35l$Hx12390a&`Paf0HzL%DKkfdJMmqp9!fByRYw`^46vdj0q4RK!5-N0t5&UAkb%ld8!+=fK{ItYi$Gw5FkK+009C7 z2oNAZfIw$~MNtdbZ4X=f0y>lW0s;gG5FkK+009C72oNC9Yk{g&3$QPs*N@BM2oNAZ zfB*pk1PBlyK!8AJfjVjdx#cqhQaU#NFR(t{b0I*0009C72oNAZfB*pk1coXwZ`A_Y zhoucQZ+Q_QK!5-N0t5&UAV7csfw2lKidsNEJHWnxvHlX|O@IIa0t5&UAV7cs0Rm$Y zs9LoE`vS)D9cl&b` bL7ivjb`iapxo*r{r+8OEo|$J|MnAV-5k@X# literal 0 HcmV?d00001 diff --git a/tests/writes_cpp/expected/output-alf_105.alf b/tests/writes_cpp/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..b9e62136f4b730ad92c95a8a2383d7ece9fdfbb0 GIT binary patch literal 33012 zcmeI*K}y3w6adh%RFJOf4N4CnX}y5Ba4UEM11Tz~t1Mimu05LG$(dGRl5IAj^9ClF zA0{RLrK`^*dAPm5dkKfuE&ldl83(anwY!hDIv%twPoN94d7kw?590W95T9Cj8C#yy zdYwlhT=&Cp^Y#6cA9~CKV*&&S5FkK+009C72uxXE8MbABnU^J;8AV7cs0RjXF5FkK+009D%7N`cb0P6xKeY;#70RjXF z5FkK+009C72oM-8(8XFnYU!N;A?$n43v3U^YzPn_K!5-N0t5&UAV7csfm0P&4r&3z zm!+L*-tr Date: Thu, 26 Feb 2026 20:36:56 -0500 Subject: [PATCH 03/12] Add empty test case --- tests/empty/expected/output-alf_104.alf | Bin 0 -> 32992 bytes tests/empty/expected/output-alf_105.alf | Bin 0 -> 33000 bytes tests/empty/expected/output-ar.txt | 0 tests/empty/expected/output-code.bin | 0 tests/empty/expected/output-dolphin.ini | 0 tests/empty/expected/output-gecko.txt | 0 tests/empty/expected/output-kamek.Base.bin | Bin 0 -> 32 bytes tests/empty/expected/output-kamek.V2.bin | Bin 0 -> 32 bytes tests/empty/expected/output-map-dynamic.map | 16 ++++++++++++++++ tests/empty/expected/output-map-static.map | 16 ++++++++++++++++ tests/empty/expected/output-riiv.xml | 0 tests/empty/externals.txt | 0 tests/empty/test.cpp | 0 13 files changed, 32 insertions(+) create mode 100644 tests/empty/expected/output-alf_104.alf create mode 100644 tests/empty/expected/output-alf_105.alf create mode 100644 tests/empty/expected/output-ar.txt create mode 100644 tests/empty/expected/output-code.bin create mode 100644 tests/empty/expected/output-dolphin.ini create mode 100644 tests/empty/expected/output-gecko.txt create mode 100644 tests/empty/expected/output-kamek.Base.bin create mode 100644 tests/empty/expected/output-kamek.V2.bin create mode 100644 tests/empty/expected/output-map-dynamic.map create mode 100644 tests/empty/expected/output-map-static.map create mode 100644 tests/empty/expected/output-riiv.xml create mode 100644 tests/empty/externals.txt create mode 100644 tests/empty/test.cpp diff --git a/tests/empty/expected/output-alf_104.alf b/tests/empty/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..a5968e440df93cd08ed9dbe5c8639ca991ee98ed GIT binary patch literal 32992 zcmeI*F>Zq}6aY}SYNfOjN5}~(LT=EZYo(r`NT6g$GBISNH}5xTB;W|{v-Ax{UjD<= zmoZ=OpC89GwejWenyR>ocpLibP~RTv2@oJafB*pk1PBlyK!5;&LItWcE@}b0Li3as z0RjXF5FkK+009C72oNA}6WGpb0bM(^_61lO1PBlyK!5-N0t5&UAV8pOfqGR7urHwO z_bodD1PBlyK!5-N0t5&UATUNPAh&#GKuSN0?**FanT`Mf0t5&UAV7cs0RjXF5GYlk zTGayfr6wvb0t5&UAV7cs0RjXF5FkKc64=ga0r~6z`vNQs0t5&UAV7cs0RjXF5Fk*t zK)tF3*cVXt`<5L60t5&UAV7cs0RjXF{Ck1#5O|E(M4a2p;na7#*SPQc`zQwEQ*^mK WM9gM3i literal 0 HcmV?d00001 diff --git a/tests/empty/expected/output-alf_105.alf b/tests/empty/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..b759b38fa69ca7ab2055ba03b5eb9d7980d4a46a GIT binary patch literal 33000 zcmeI*K~97)6adg_#zb9lggL>4!5g@6JBc?Sfs7{ViiJz&=KjK%07vM&CM~pS7yrTP zrrYdft9)|vRsOLc~0RjXF5FkK+009C72oNAps6ds*RW9IIXq>_# zK!5-N0t5&UAV7cs0RjYOf&C&E(6vKrUw}7*009C72oNAZfB*pk1PGKZP;YVp_63yv zyhTTV009C72oNAZfB*pk1jfh( YH(!>so7L^$>fu_7=016!gf-T(jq literal 0 HcmV?d00001 diff --git a/tests/empty/expected/output-ar.txt b/tests/empty/expected/output-ar.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/empty/expected/output-code.bin b/tests/empty/expected/output-code.bin new file mode 100644 index 0000000..e69de29 diff --git a/tests/empty/expected/output-dolphin.ini b/tests/empty/expected/output-dolphin.ini new file mode 100644 index 0000000..e69de29 diff --git a/tests/empty/expected/output-gecko.txt b/tests/empty/expected/output-gecko.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/empty/expected/output-kamek.Base.bin b/tests/empty/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..79fc9e2d6c98e98b41c50feb173c73c6073cbef9 GIT binary patch literal 32 RcmeZH%uUT^U|?dv0RTB%0qg(( literal 0 HcmV?d00001 diff --git a/tests/empty/expected/output-kamek.V2.bin b/tests/empty/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..79fc9e2d6c98e98b41c50feb173c73c6073cbef9 GIT binary patch literal 32 RcmeZH%uUT^U|?dv0RTB%0qg(( literal 0 HcmV?d00001 diff --git a/tests/empty/expected/output-map-dynamic.map b/tests/empty/expected/output-map-dynamic.map new file mode 100644 index 0000000..c922538 --- /dev/null +++ b/tests/empty/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 __ctor_loc + 00000000 000000 __ctor_end + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000000 000000 _e_text + 00000000 000000 _f_ctors + 00000000 000000 _e_ctors + 00000000 000000 _f_dtors + 00000000 000000 _e_dtors + 00000000 000000 _f_rodata + 00000000 000000 _e_rodata + 00000000 000000 _f_data + 00000000 000000 _e_data diff --git a/tests/empty/expected/output-map-static.map b/tests/empty/expected/output-map-static.map new file mode 100644 index 0000000..931fd5b --- /dev/null +++ b/tests/empty/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 __ctor_loc + 82000000 000000 __ctor_end + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000000 000000 _e_text + 82000000 000000 _f_ctors + 82000000 000000 _e_ctors + 82000000 000000 _f_dtors + 82000000 000000 _e_dtors + 82000000 000000 _f_rodata + 82000000 000000 _e_rodata + 82000000 000000 _f_data + 82000000 000000 _e_data diff --git a/tests/empty/expected/output-riiv.xml b/tests/empty/expected/output-riiv.xml new file mode 100644 index 0000000..e69de29 diff --git a/tests/empty/externals.txt b/tests/empty/externals.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/empty/test.cpp b/tests/empty/test.cpp new file mode 100644 index 0000000..e69de29 From 2ac63947636a1e0bfeb0faf46fa5eaae57229d52 Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Fri, 27 Feb 2026 00:22:25 -0500 Subject: [PATCH 04/12] Add tests for the remaining asm macros --- tests/kamek_b_bl/expected/output-alf_104.alf | Bin 0 -> 33012 bytes tests/kamek_b_bl/expected/output-alf_105.alf | Bin 0 -> 33020 bytes tests/kamek_b_bl/expected/output-ar.txt | 2 ++ tests/kamek_b_bl/expected/output-code.bin | Bin 0 -> 8 bytes tests/kamek_b_bl/expected/output-dolphin.ini | 2 ++ tests/kamek_b_bl/expected/output-gecko.txt | 2 ++ tests/kamek_b_bl/expected/output-kamek.Base.bin | Bin 0 -> 56 bytes tests/kamek_b_bl/expected/output-kamek.V2.bin | Bin 0 -> 56 bytes .../kamek_b_bl/expected/output-map-dynamic.map | 16 ++++++++++++++++ tests/kamek_b_bl/expected/output-map-static.map | 16 ++++++++++++++++ tests/kamek_b_bl/expected/output-riiv.xml | 1 + tests/kamek_b_bl/externals.txt | 0 tests/kamek_b_bl/test.S | 5 +++++ .../expected/output-alf_104.alf | Bin 0 -> 33016 bytes .../expected/output-alf_105.alf | Bin 0 -> 33024 bytes tests/kamek_const_float/expected/output-ar.txt | 3 +++ .../kamek_const_float/expected/output-code.bin | Bin 0 -> 12 bytes .../expected/output-dolphin.ini | 3 +++ .../kamek_const_float/expected/output-gecko.txt | 3 +++ .../expected/output-kamek.Base.bin | Bin 0 -> 60 bytes .../expected/output-kamek.V2.bin | Bin 0 -> 60 bytes .../expected/output-map-dynamic.map | 16 ++++++++++++++++ .../expected/output-map-static.map | 16 ++++++++++++++++ .../kamek_const_float/expected/output-riiv.xml | 1 + tests/kamek_const_float/externals.txt | 0 tests/kamek_const_float/test.S | 4 ++++ tests/kamek_ref/expected/output-alf_104.alf | Bin 0 -> 33052 bytes tests/kamek_ref/expected/output-alf_105.alf | Bin 0 -> 33060 bytes tests/kamek_ref/expected/output-ar.txt | 12 ++++++++++++ tests/kamek_ref/expected/output-code.bin | Bin 0 -> 48 bytes tests/kamek_ref/expected/output-dolphin.ini | 12 ++++++++++++ tests/kamek_ref/expected/output-gecko.txt | 7 +++++++ tests/kamek_ref/expected/output-kamek.Base.bin | Bin 0 -> 80 bytes tests/kamek_ref/expected/output-kamek.V2.bin | Bin 0 -> 80 bytes tests/kamek_ref/expected/output-map-dynamic.map | 16 ++++++++++++++++ tests/kamek_ref/expected/output-map-static.map | 16 ++++++++++++++++ tests/kamek_ref/expected/output-riiv.xml | 1 + tests/kamek_ref/externals.txt | 0 tests/kamek_ref/test.S | 9 +++++++++ .../expected/output-alf_104.alf | Bin 0 -> 33012 bytes .../expected/output-alf_105.alf | Bin 0 -> 33020 bytes tests/kamek_ref_address/expected/output-ar.txt | 2 ++ .../kamek_ref_address/expected/output-code.bin | Bin 0 -> 8 bytes .../expected/output-dolphin.ini | 2 ++ .../kamek_ref_address/expected/output-gecko.txt | 2 ++ .../expected/output-kamek.Base.bin | Bin 0 -> 40 bytes .../expected/output-kamek.V2.bin | Bin 0 -> 40 bytes .../expected/output-map-dynamic.map | 16 ++++++++++++++++ .../expected/output-map-static.map | 16 ++++++++++++++++ .../kamek_ref_address/expected/output-riiv.xml | 1 + tests/kamek_ref_address/externals.txt | 0 tests/kamek_ref_address/test.S | 4 ++++ 52 files changed, 206 insertions(+) create mode 100644 tests/kamek_b_bl/expected/output-alf_104.alf create mode 100644 tests/kamek_b_bl/expected/output-alf_105.alf create mode 100644 tests/kamek_b_bl/expected/output-ar.txt create mode 100644 tests/kamek_b_bl/expected/output-code.bin create mode 100644 tests/kamek_b_bl/expected/output-dolphin.ini create mode 100644 tests/kamek_b_bl/expected/output-gecko.txt create mode 100644 tests/kamek_b_bl/expected/output-kamek.Base.bin create mode 100644 tests/kamek_b_bl/expected/output-kamek.V2.bin create mode 100644 tests/kamek_b_bl/expected/output-map-dynamic.map create mode 100644 tests/kamek_b_bl/expected/output-map-static.map create mode 100644 tests/kamek_b_bl/expected/output-riiv.xml create mode 100644 tests/kamek_b_bl/externals.txt create mode 100644 tests/kamek_b_bl/test.S create mode 100644 tests/kamek_const_float/expected/output-alf_104.alf create mode 100644 tests/kamek_const_float/expected/output-alf_105.alf create mode 100644 tests/kamek_const_float/expected/output-ar.txt create mode 100644 tests/kamek_const_float/expected/output-code.bin create mode 100644 tests/kamek_const_float/expected/output-dolphin.ini create mode 100644 tests/kamek_const_float/expected/output-gecko.txt create mode 100644 tests/kamek_const_float/expected/output-kamek.Base.bin create mode 100644 tests/kamek_const_float/expected/output-kamek.V2.bin create mode 100644 tests/kamek_const_float/expected/output-map-dynamic.map create mode 100644 tests/kamek_const_float/expected/output-map-static.map create mode 100644 tests/kamek_const_float/expected/output-riiv.xml create mode 100644 tests/kamek_const_float/externals.txt create mode 100644 tests/kamek_const_float/test.S create mode 100644 tests/kamek_ref/expected/output-alf_104.alf create mode 100644 tests/kamek_ref/expected/output-alf_105.alf create mode 100644 tests/kamek_ref/expected/output-ar.txt create mode 100644 tests/kamek_ref/expected/output-code.bin create mode 100644 tests/kamek_ref/expected/output-dolphin.ini create mode 100644 tests/kamek_ref/expected/output-gecko.txt create mode 100644 tests/kamek_ref/expected/output-kamek.Base.bin create mode 100644 tests/kamek_ref/expected/output-kamek.V2.bin create mode 100644 tests/kamek_ref/expected/output-map-dynamic.map create mode 100644 tests/kamek_ref/expected/output-map-static.map create mode 100644 tests/kamek_ref/expected/output-riiv.xml create mode 100644 tests/kamek_ref/externals.txt create mode 100644 tests/kamek_ref/test.S create mode 100644 tests/kamek_ref_address/expected/output-alf_104.alf create mode 100644 tests/kamek_ref_address/expected/output-alf_105.alf create mode 100644 tests/kamek_ref_address/expected/output-ar.txt create mode 100644 tests/kamek_ref_address/expected/output-code.bin create mode 100644 tests/kamek_ref_address/expected/output-dolphin.ini create mode 100644 tests/kamek_ref_address/expected/output-gecko.txt create mode 100644 tests/kamek_ref_address/expected/output-kamek.Base.bin create mode 100644 tests/kamek_ref_address/expected/output-kamek.V2.bin create mode 100644 tests/kamek_ref_address/expected/output-map-dynamic.map create mode 100644 tests/kamek_ref_address/expected/output-map-static.map create mode 100644 tests/kamek_ref_address/expected/output-riiv.xml create mode 100644 tests/kamek_ref_address/externals.txt create mode 100644 tests/kamek_ref_address/test.S diff --git a/tests/kamek_b_bl/expected/output-alf_104.alf b/tests/kamek_b_bl/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..d8be8e2e1cb9efaa1cdae835079717995a02f055 GIT binary patch literal 33012 zcmeI*F;2rU6aY|zKti2zgq{GU;RXy0bU@++L`nn$FlAs&xi@ORQz|7ng7qwY$FaQp z=S*Kt^7{Dl^pU1EZvL;Sib2Hv(Ekkec~Vb+009C72oNAZfB*pk1PBx=P^EEE3)mH! zr?dzVAV7cs0RjXF5FkK+0D-f>c2*1M+M#tWz>`6M009C72oNAZfB*pk1j-huSG54= z0?OWR*%2T>fB*pk1PBlyK!5;&F=_$1-wtptz=J`6009C72oNAZfB*pk z1j-huSG54=0?OWR*%2T>fB*pk1PBlyK!5;&lz#6*A;&)A`FQ+$i|chnp8IOQ-#`0q iw~2ArU+&^&yooNitBBdkX0ftK@y~+1GOxOgxU>`8YAp8v literal 0 HcmV?d00001 diff --git a/tests/kamek_b_bl/expected/output-alf_105.alf b/tests/kamek_b_bl/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..318d021af04bb944002852235bc4e77ea7303319 GIT binary patch literal 33020 zcmeI*K}y6h6adgD3Nou6VNM{OdIJ|ObRl?yLW>IOY8Ea#-do0>wnEz@gcnHCq-o*5 zcJ;}0UhbbC-qToy-Q1@t4x-*3`|o2tO=<}cAV7cs0RjXF5FkK+0D(dUsx+)}0f$24 z6czyj1PBlyK!5-N0t5&UATSB+7rB70J+}4*cryqPAV7cs0RjXF5FkK+K-mKICKq5| zK-te*bOZBVysJI9aAV7cs0RjXF5FkK+0D)0pzsLpTZwJ^H;Kd+7fB*pk1PBlyK!5-N z0%Z%-n_Pf>0cAgL(Geg(fB*pk1PBlyK!5;&lzwhPA=jsjX*Y#W&qIufSCiY literal 0 HcmV?d00001 diff --git a/tests/kamek_b_bl/expected/output-kamek.V2.bin b/tests/kamek_b_bl/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..cf7f192fca2049c7b775f1ec9d1c204b579137b0 GIT binary patch literal 56 pcmeZH%uUT^U|?c^01hAp!(b5)APK~bTnr2>jSK<|K$-zW0|0?p1J3{e literal 0 HcmV?d00001 diff --git a/tests/kamek_b_bl/expected/output-map-dynamic.map b/tests/kamek_b_bl/expected/output-map-dynamic.map new file mode 100644 index 0000000..e4619f4 --- /dev/null +++ b/tests/kamek_b_bl/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000008 000000 __ctor_loc + 00000008 000000 __ctor_end + 00000008 000000 _e_text + 00000008 000000 _f_ctors + 00000008 000000 _e_ctors + 00000008 000000 _f_dtors + 00000008 000000 _e_dtors + 00000008 000000 _f_rodata + 00000008 000000 _e_rodata + 00000008 000000 _f_data + 00000008 000000 _e_data diff --git a/tests/kamek_b_bl/expected/output-map-static.map b/tests/kamek_b_bl/expected/output-map-static.map new file mode 100644 index 0000000..c7e480c --- /dev/null +++ b/tests/kamek_b_bl/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000008 000000 __ctor_loc + 82000008 000000 __ctor_end + 82000008 000000 _e_text + 82000008 000000 _f_ctors + 82000008 000000 _e_ctors + 82000008 000000 _f_dtors + 82000008 000000 _e_dtors + 82000008 000000 _f_rodata + 82000008 000000 _e_rodata + 82000008 000000 _f_data + 82000008 000000 _e_data diff --git a/tests/kamek_b_bl/expected/output-riiv.xml b/tests/kamek_b_bl/expected/output-riiv.xml new file mode 100644 index 0000000..8e2696d --- /dev/null +++ b/tests/kamek_b_bl/expected/output-riiv.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/kamek_b_bl/externals.txt b/tests/kamek_b_bl/externals.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/kamek_b_bl/test.S b/tests/kamek_b_bl/test.S new file mode 100644 index 0000000..842d242 --- /dev/null +++ b/tests/kamek_b_bl/test.S @@ -0,0 +1,5 @@ +#include + +func: + kamek_b 0x81000000 + kamek_bl 0x81000000 diff --git a/tests/kamek_const_float/expected/output-alf_104.alf b/tests/kamek_const_float/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..34b7b2d05e30d278aec3660c63a1620192c03bee GIT binary patch literal 33016 zcmeI*K}y3w6adgs6iRWCBNW_A8n=Sr!mZ#5T1e1^y6U3K*jv=ocr^c{7Lpuccmsbj z6K3;YX7!mQuTL+}?`dfL^8cEu7)0Fdy8W&`-P98xK!5-N0t5&UAV7cs0Rn{zRH>iT z0@j7*DJ=p72oNAZfB*pk1PBlyK;R^>8r1^Y?QZK_fSo~r009C72oNAZfB*pk1j-hu zXSD$50?K~gvLir%009C72oNAZfB*pkebfSS%ij!0>3j0NKr`Ia5gm60t5&UAV7cs0RjXFq;$9mg&Yr?L;AffXA|?w sh(*Nb_UrAVYuC#dx7~Rblm05Y+%6(UE1Sv6CdGdX^2)sGI^x{^0Eyi#g8%>k literal 0 HcmV?d00001 diff --git a/tests/kamek_const_float/expected/output-alf_105.alf b/tests/kamek_const_float/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..6df8d14d48232a0237fa3b7ee006072f1cc793fc GIT binary patch literal 33024 zcmeI*K}y6h6adgD3d7){M;LG~ow^kS7j6Yl;6RHC>Z%Kub#5`9#-sVuDs*~;@B&Gb zk}m#BSD!R}ynDERO=B6>f7et+C+bz-efITqQ%isV0RjXF5FkK+009C72ox$%rQs+S zuq`xBVG$refB*pk1PBlyK!5-N0+YaImJ4Wi{m#AsZw3JZ1PBlyK!5-N0t5&UC|jUj z*#xdX1u2%K!5-N0t5&UAV7cs z0RjX{6{r@ufa_8N6&C>l1PBlyK!5-N0t5&UATSDSX1RcTc7S~WUJL>R2oNAZfB*pk z1PBlyP_{t5$OYIJQ1*I@jsO7y1PBlyK!5-N0t5)8w7&?2TyLKC>E|-7ZV!j=ml&T$ uT}6H0eLTN)?RFjgw)-E&U^t5=my_u-pWPhIZc_ZaAkWS-&u35M2Y&%v7cGqd literal 0 HcmV?d00001 diff --git a/tests/kamek_const_float/expected/output-ar.txt b/tests/kamek_const_float/expected/output-ar.txt new file mode 100644 index 0000000..8b670f4 --- /dev/null +++ b/tests/kamek_const_float/expected/output-ar.txt @@ -0,0 +1,3 @@ +04000000 3C608200 +04000004 C0230008 +04000008 3F99999A \ No newline at end of file diff --git a/tests/kamek_const_float/expected/output-code.bin b/tests/kamek_const_float/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..340ee19f5cbc671026ec8e4117c097c09bee9817 GIT binary patch literal 12 TcmcCXXks{^%)ntkbLK1n7r+D+ literal 0 HcmV?d00001 diff --git a/tests/kamek_const_float/expected/output-dolphin.ini b/tests/kamek_const_float/expected/output-dolphin.ini new file mode 100644 index 0000000..8ecb428 --- /dev/null +++ b/tests/kamek_const_float/expected/output-dolphin.ini @@ -0,0 +1,3 @@ +0x82000000:dword:0x3C608200 +0x82000004:dword:0xC0230008 +0x82000008:dword:0x3F99999A \ No newline at end of file diff --git a/tests/kamek_const_float/expected/output-gecko.txt b/tests/kamek_const_float/expected/output-gecko.txt new file mode 100644 index 0000000..9db46da --- /dev/null +++ b/tests/kamek_const_float/expected/output-gecko.txt @@ -0,0 +1,3 @@ +06000000 00000010 +3C608200 C0230008 +3F99999A 00000000 \ No newline at end of file diff --git a/tests/kamek_const_float/expected/output-kamek.Base.bin b/tests/kamek_const_float/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..0abdbad9331ca5ded06df4497a651e368819d0fd GIT binary patch literal 60 vcmeZH%uUT^U|?c^03IO40mWbun*;`i1Ii2x_A_VBVqsul1IYmika`XPzvu \ No newline at end of file diff --git a/tests/kamek_const_float/externals.txt b/tests/kamek_const_float/externals.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/kamek_const_float/test.S b/tests/kamek_const_float/test.S new file mode 100644 index 0000000..e2b6e0c --- /dev/null +++ b/tests/kamek_const_float/test.S @@ -0,0 +1,4 @@ +#include + +func: + kamek_const_float f1, 1.2, r3 diff --git a/tests/kamek_ref/expected/output-alf_104.alf b/tests/kamek_ref/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..ce263b3e229f555a614ca707596f4580a811273a GIT binary patch literal 33052 zcmeI*Jx&5a6ae6-!GsWtEj$1Ty#Z{gENo3Y0mLO*s1=3f;wda`^c)<)Bl!j-0gf>F zCV4aaGh4iGw|be~eYm~9dyZ}E2LEF;xsh?bTE4HwyMuZH1PBlyK!5-N0t5&UAV8o} zfhM}6TEL{zJf%f|009C72oNAZfB*pk1PJT|h6lBPcClJm7vRYtK!5-N0t5&UAV7cs z0RnXkj8AF-)&n+a literal 0 HcmV?d00001 diff --git a/tests/kamek_ref/expected/output-alf_105.alf b/tests/kamek_ref/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..6fc5bafe384f3f85f00b6e77204a88a4bbf5a6b4 GIT binary patch literal 33060 zcmeI*F-ikL6adh#LYNAgdiu*ngI zH!$;eH#5b5yVYm1dwX?r{S@2Qjs9XZd64~lwR~GmcNdKW2oNAZfB*pk1PBlyK!8A{ z0!?&#wSbFC^OP0=0t5&UAV7cs0RjXF5FoG<824%c?P9gCFTj&QfB*pk1PBlyK!5-N z0tD(7m>$#u>cb~D# z*v4S~xsH#o7|u5tzvHz0zL`W*;?E?`9&^oc_F?vy#p}cKvb`APal8CK%ad-9Lup65 W(4Rfqn>~yCzCoE?W}fs`l!d>Ewl{+S literal 0 HcmV?d00001 diff --git a/tests/kamek_ref/expected/output-ar.txt b/tests/kamek_ref/expected/output-ar.txt new file mode 100644 index 0000000..e26d688 --- /dev/null +++ b/tests/kamek_ref/expected/output-ar.txt @@ -0,0 +1,12 @@ +04000000 3C608100 +04000004 80630000 +04000008 3C808100 +0400000C 80640004 +04000010 3CA08100 +04000014 98A50008 +04000018 3CC08100 +0400001C 98A6000C +04000020 3C608100 +04000024 C0230010 +04000028 3C608100 +0400002C D0230014 \ No newline at end of file diff --git a/tests/kamek_ref/expected/output-code.bin b/tests/kamek_ref/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..8cb603d720605017a24c874ef37742c11b5c47b5 GIT binary patch literal 48 xcmcCXXk=(eW?-;s0MaQ8EH(=o8D=bH;IKIWq?a-9*Z}1ZC^HCv=nKjWA^=&Z4Z{Ec literal 0 HcmV?d00001 diff --git a/tests/kamek_ref/expected/output-dolphin.ini b/tests/kamek_ref/expected/output-dolphin.ini new file mode 100644 index 0000000..e568077 --- /dev/null +++ b/tests/kamek_ref/expected/output-dolphin.ini @@ -0,0 +1,12 @@ +0x82000000:dword:0x3C608100 +0x82000004:dword:0x80630000 +0x82000008:dword:0x3C808100 +0x8200000C:dword:0x80640004 +0x82000010:dword:0x3CA08100 +0x82000014:dword:0x98A50008 +0x82000018:dword:0x3CC08100 +0x8200001C:dword:0x98A6000C +0x82000020:dword:0x3C608100 +0x82000024:dword:0xC0230010 +0x82000028:dword:0x3C608100 +0x8200002C:dword:0xD0230014 \ No newline at end of file diff --git a/tests/kamek_ref/expected/output-gecko.txt b/tests/kamek_ref/expected/output-gecko.txt new file mode 100644 index 0000000..4148ab5 --- /dev/null +++ b/tests/kamek_ref/expected/output-gecko.txt @@ -0,0 +1,7 @@ +06000000 00000030 +3C608100 80630000 +3C808100 80640004 +3CA08100 98A50008 +3CC08100 98A6000C +3C608100 C0230010 +3C608100 D0230014 \ No newline at end of file diff --git a/tests/kamek_ref/expected/output-kamek.Base.bin b/tests/kamek_ref/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..aa6e4a4df1899a8e7d1fe8d5544b3c03e879564d GIT binary patch literal 80 zcmeZH%uUT^U|?c^00STe!(b7cghqyjWCjMC1|Xfnz+$tYkzvMC1`eA8KzbPi4@mxi NGJ^n!zM#w?0ss+m5Iz6^ literal 0 HcmV?d00001 diff --git a/tests/kamek_ref/expected/output-kamek.V2.bin b/tests/kamek_ref/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..5f5175afc32343759a2386e78c4d5bae22b75954 GIT binary patch literal 80 zcmeZH%uUT^U|?c^00STe!(b7cghqyjWB~@71|Xdxz+$tYkzvMC0S=o3Kzf+~4@mxi NvVZ`HzMw210stAZ5S{=4 literal 0 HcmV?d00001 diff --git a/tests/kamek_ref/expected/output-map-dynamic.map b/tests/kamek_ref/expected/output-map-dynamic.map new file mode 100644 index 0000000..ed0a7eb --- /dev/null +++ b/tests/kamek_ref/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000030 000000 __ctor_loc + 00000030 000000 __ctor_end + 00000030 000000 _e_text + 00000030 000000 _f_ctors + 00000030 000000 _e_ctors + 00000030 000000 _f_dtors + 00000030 000000 _e_dtors + 00000030 000000 _f_rodata + 00000030 000000 _e_rodata + 00000030 000000 _f_data + 00000030 000000 _e_data diff --git a/tests/kamek_ref/expected/output-map-static.map b/tests/kamek_ref/expected/output-map-static.map new file mode 100644 index 0000000..7f336e4 --- /dev/null +++ b/tests/kamek_ref/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000030 000000 __ctor_loc + 82000030 000000 __ctor_end + 82000030 000000 _e_text + 82000030 000000 _f_ctors + 82000030 000000 _e_ctors + 82000030 000000 _f_dtors + 82000030 000000 _e_dtors + 82000030 000000 _f_rodata + 82000030 000000 _e_rodata + 82000030 000000 _f_data + 82000030 000000 _e_data diff --git a/tests/kamek_ref/expected/output-riiv.xml b/tests/kamek_ref/expected/output-riiv.xml new file mode 100644 index 0000000..82d5db3 --- /dev/null +++ b/tests/kamek_ref/expected/output-riiv.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/kamek_ref/externals.txt b/tests/kamek_ref/externals.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/kamek_ref/test.S b/tests/kamek_ref/test.S new file mode 100644 index 0000000..6375d14 --- /dev/null +++ b/tests/kamek_ref/test.S @@ -0,0 +1,9 @@ +#include + +func: + kamek_ref lwz, r3, 0x81000000, r3 + kamek_ref lwz, r3, 0x81000004, r4 + kamek_ref stb, r5, 0x81000008, r5 + kamek_ref stb, r5, 0x8100000c, r6 + kamek_ref lfs, f1, 0x81000010, r3 + kamek_ref stfs, f1, 0x81000014, r3 diff --git a/tests/kamek_ref_address/expected/output-alf_104.alf b/tests/kamek_ref_address/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..08d253248cd7b474bf1f98c644855c0c1f3d2b63 GIT binary patch literal 33012 zcmeI*F;2rU6aY|zKti2zgq{GUVPRlm=!(P%8j%PFV9LOla`Jwssnp~M*0W?McAVkA zWcqTP_t&@mSDMPWnUAT8lc# zQ1R2oNAZfB*pk1PBly zP_{t5$^}>#Q1Hi@Va(y`*)AL74hd95T$9~%1&+oq5 kZKB`xmtJ(nyJ&K`iJI@8uQiLAO^SaOOV literal 0 HcmV?d00001 diff --git a/tests/kamek_ref_address/expected/output-alf_105.alf b/tests/kamek_ref_address/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..ef24c7f65de962fc5343d935e7c2b5e6aef148d5 GIT binary patch literal 33020 zcmeI*K~97)6adh#(ZtM(Bg_d5gBusFT(~vy1QH=?qOMrXlJVrWfCDy5FkK+009C72oNAZU=rA`asm0<0oDb0FbEJJK!5-N0t5&UAV7dX z*#h-hF2K5gvhTO(2oNAZfB*pk1PBlyK!8BR?@dz3+r#TA?%yIl((&ce_uc-yfA!sA mm)c$b-%5?~Dpk2$%)99d%lT$Ax{37Pf;>8pyk5=76aN6?C@U!d literal 0 HcmV?d00001 diff --git a/tests/kamek_ref_address/expected/output-ar.txt b/tests/kamek_ref_address/expected/output-ar.txt new file mode 100644 index 0000000..9e115b3 --- /dev/null +++ b/tests/kamek_ref_address/expected/output-ar.txt @@ -0,0 +1,2 @@ +04000000 3C608100 +04000004 38630000 \ No newline at end of file diff --git a/tests/kamek_ref_address/expected/output-code.bin b/tests/kamek_ref_address/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..65eb35744d553907c35181b2f8cffff6ee5a5c88 GIT binary patch literal 8 PcmcCXXk@TRW?%pS36}x6 literal 0 HcmV?d00001 diff --git a/tests/kamek_ref_address/expected/output-dolphin.ini b/tests/kamek_ref_address/expected/output-dolphin.ini new file mode 100644 index 0000000..df9e500 --- /dev/null +++ b/tests/kamek_ref_address/expected/output-dolphin.ini @@ -0,0 +1,2 @@ +0x82000000:dword:0x3C608100 +0x82000004:dword:0x38630000 \ No newline at end of file diff --git a/tests/kamek_ref_address/expected/output-gecko.txt b/tests/kamek_ref_address/expected/output-gecko.txt new file mode 100644 index 0000000..1f508fb --- /dev/null +++ b/tests/kamek_ref_address/expected/output-gecko.txt @@ -0,0 +1,2 @@ +06000000 00000008 +3C608100 38630000 \ No newline at end of file diff --git a/tests/kamek_ref_address/expected/output-kamek.Base.bin b/tests/kamek_ref_address/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..adc3f9424f72f9b7aa7c6f35731711ea5a022818 GIT binary patch literal 40 fcmeZH%uUT^U|?c^01hAp!(b7cghmF7WCjKRR6_&2 literal 0 HcmV?d00001 diff --git a/tests/kamek_ref_address/expected/output-kamek.V2.bin b/tests/kamek_ref_address/expected/output-kamek.V2.bin new file mode 100644 index 0000000000000000000000000000000000000000..87e29e3a6ac6fb66a5b2e068fa5e747af55b5697 GIT binary patch literal 40 fcmeZH%uUT^U|?c^01hAp!(b7cghmF7WB~>MRAU3o literal 0 HcmV?d00001 diff --git a/tests/kamek_ref_address/expected/output-map-dynamic.map b/tests/kamek_ref_address/expected/output-map-dynamic.map new file mode 100644 index 0000000..e4619f4 --- /dev/null +++ b/tests/kamek_ref_address/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000008 000000 __ctor_loc + 00000008 000000 __ctor_end + 00000008 000000 _e_text + 00000008 000000 _f_ctors + 00000008 000000 _e_ctors + 00000008 000000 _f_dtors + 00000008 000000 _e_dtors + 00000008 000000 _f_rodata + 00000008 000000 _e_rodata + 00000008 000000 _f_data + 00000008 000000 _e_data diff --git a/tests/kamek_ref_address/expected/output-map-static.map b/tests/kamek_ref_address/expected/output-map-static.map new file mode 100644 index 0000000..c7e480c --- /dev/null +++ b/tests/kamek_ref_address/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000008 000000 __ctor_loc + 82000008 000000 __ctor_end + 82000008 000000 _e_text + 82000008 000000 _f_ctors + 82000008 000000 _e_ctors + 82000008 000000 _f_dtors + 82000008 000000 _e_dtors + 82000008 000000 _f_rodata + 82000008 000000 _e_rodata + 82000008 000000 _f_data + 82000008 000000 _e_data diff --git a/tests/kamek_ref_address/expected/output-riiv.xml b/tests/kamek_ref_address/expected/output-riiv.xml new file mode 100644 index 0000000..70b8772 --- /dev/null +++ b/tests/kamek_ref_address/expected/output-riiv.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/kamek_ref_address/externals.txt b/tests/kamek_ref_address/externals.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/kamek_ref_address/test.S b/tests/kamek_ref_address/test.S new file mode 100644 index 0000000..eb8341a --- /dev/null +++ b/tests/kamek_ref_address/test.S @@ -0,0 +1,4 @@ +#include + +func: + kamek_ref_address r3, 0x81000000 From a011d2334511080125453b251a9af4c638b0a6b0 Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Fri, 27 Feb 2026 00:25:34 -0500 Subject: [PATCH 05/12] Make externals file optional in tests --- tests/empty/externals.txt | 0 tests/kamek_b_bl/externals.txt | 0 tests/kamek_const_float/externals.txt | 0 tests/kamek_ref/externals.txt | 0 tests/kamek_ref_address/externals.txt | 0 tests/run_tests.py | 10 +++++++--- 6 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 tests/empty/externals.txt delete mode 100644 tests/kamek_b_bl/externals.txt delete mode 100644 tests/kamek_const_float/externals.txt delete mode 100644 tests/kamek_ref/externals.txt delete mode 100644 tests/kamek_ref_address/externals.txt diff --git a/tests/empty/externals.txt b/tests/empty/externals.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/kamek_b_bl/externals.txt b/tests/kamek_b_bl/externals.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/kamek_const_float/externals.txt b/tests/kamek_const_float/externals.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/kamek_ref/externals.txt b/tests/kamek_ref/externals.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/kamek_ref_address/externals.txt b/tests/kamek_ref_address/externals.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/run_tests.py b/tests/run_tests.py index 4b3abd8..d08c689 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -39,11 +39,13 @@ def compile_s(s_path: Path, o_path: Path) -> None: def kamek_static_link(o_files: list[Path], *, static: int, externals: Path, output_dir: Path) -> None: + externals_arg = [f'-externals={externals}'] if externals.is_file() else [] + subprocess.run([ str(KAMEK_EXE), '-q', f'-static=0x{static:08x}', - f'-externals={externals}', + *externals_arg, f'-output-riiv={output_dir / "output-riiv.xml"}', f'-output-dolphin={output_dir / "output-dolphin.ini"}', f'-output-gecko={output_dir / "output-gecko.txt"}', @@ -60,7 +62,7 @@ def kamek_static_link(o_files: list[Path], *, static: int, externals: Path, outp str(KAMEK_EXE), '-q', f'-static=0x{static:08x}', - f'-externals={externals}', + *externals_arg, f'-input-alf=sample_105.alf', f'-output-alf={output_dir / "output-alf_105.alf"}', *(str(o) for o in o_files), @@ -68,11 +70,13 @@ def kamek_static_link(o_files: list[Path], *, static: int, externals: Path, outp def kamek_dynamic_link(o_files: list[Path], *, externals: Path, versions: Path, output_dir: Path) -> None: + externals_arg = [f'-externals={externals}'] if externals.is_file() else [] + subprocess.run([ str(KAMEK_EXE), '-q', '-dynamic', - f'-externals={externals}', + *externals_arg, f'-versions={versions}', f'-output-kamek={output_dir / "output-kamek.$KV$.bin"}', f'-output-map={output_dir / "output-map-dynamic.map"}', From a540848b151f96944754a9ce3e1a3981e4cfdebc Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Tue, 3 Mar 2026 15:02:42 -0500 Subject: [PATCH 06/12] Add linkage tests --- tests/linkage_asm/expected/output-alf_104.alf | Bin 0 -> 33060 bytes tests/linkage_asm/expected/output-alf_105.alf | Bin 0 -> 33068 bytes tests/linkage_asm/expected/output-ar.txt | 14 +++++++ tests/linkage_asm/expected/output-code.bin | Bin 0 -> 56 bytes tests/linkage_asm/expected/output-dolphin.ini | 14 +++++++ tests/linkage_asm/expected/output-gecko.txt | 8 ++++ .../expected/output-kamek.Base.bin | Bin 0 -> 120 bytes .../linkage_asm/expected/output-kamek.V2.bin | Bin 0 -> 120 bytes .../expected/output-map-dynamic.map | 16 +++++++ .../expected/output-map-static.map | 16 +++++++ tests/linkage_asm/expected/output-riiv.xml | 1 + tests/linkage_asm/externals.txt | 2 + tests/linkage_asm/test.S | 20 +++++++++ tests/linkage_cpp/expected/output-alf_104.alf | Bin 0 -> 33160 bytes tests/linkage_cpp/expected/output-alf_105.alf | Bin 0 -> 33168 bytes tests/linkage_cpp/expected/output-ar.txt | 39 ++++++++++++++++++ tests/linkage_cpp/expected/output-code.bin | Bin 0 -> 156 bytes tests/linkage_cpp/expected/output-dolphin.ini | 39 ++++++++++++++++++ tests/linkage_cpp/expected/output-gecko.txt | 21 ++++++++++ .../expected/output-kamek.Base.bin | Bin 0 -> 252 bytes .../linkage_cpp/expected/output-kamek.V2.bin | Bin 0 -> 252 bytes .../expected/output-map-dynamic.map | 20 +++++++++ .../expected/output-map-static.map | 20 +++++++++ tests/linkage_cpp/expected/output-riiv.xml | 1 + tests/linkage_cpp/externals.txt | 2 + tests/linkage_cpp/test.cpp | 38 +++++++++++++++++ 26 files changed, 271 insertions(+) create mode 100644 tests/linkage_asm/expected/output-alf_104.alf create mode 100644 tests/linkage_asm/expected/output-alf_105.alf create mode 100644 tests/linkage_asm/expected/output-ar.txt create mode 100644 tests/linkage_asm/expected/output-code.bin create mode 100644 tests/linkage_asm/expected/output-dolphin.ini create mode 100644 tests/linkage_asm/expected/output-gecko.txt create mode 100644 tests/linkage_asm/expected/output-kamek.Base.bin create mode 100644 tests/linkage_asm/expected/output-kamek.V2.bin create mode 100644 tests/linkage_asm/expected/output-map-dynamic.map create mode 100644 tests/linkage_asm/expected/output-map-static.map create mode 100644 tests/linkage_asm/expected/output-riiv.xml create mode 100644 tests/linkage_asm/externals.txt create mode 100644 tests/linkage_asm/test.S create mode 100644 tests/linkage_cpp/expected/output-alf_104.alf create mode 100644 tests/linkage_cpp/expected/output-alf_105.alf create mode 100644 tests/linkage_cpp/expected/output-ar.txt create mode 100644 tests/linkage_cpp/expected/output-code.bin create mode 100644 tests/linkage_cpp/expected/output-dolphin.ini create mode 100644 tests/linkage_cpp/expected/output-gecko.txt create mode 100644 tests/linkage_cpp/expected/output-kamek.Base.bin create mode 100644 tests/linkage_cpp/expected/output-kamek.V2.bin create mode 100644 tests/linkage_cpp/expected/output-map-dynamic.map create mode 100644 tests/linkage_cpp/expected/output-map-static.map create mode 100644 tests/linkage_cpp/expected/output-riiv.xml create mode 100644 tests/linkage_cpp/externals.txt create mode 100644 tests/linkage_cpp/test.cpp diff --git a/tests/linkage_asm/expected/output-alf_104.alf b/tests/linkage_asm/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..b441ddf29ac8a3bc13c3978727dac986b68fede1 GIT binary patch literal 33060 zcmeI*u};EJ6adhN!Nf2%d;uR|44^|-9b6bp`~sUmbPy*7$HFHY2RFQrLPGh3mvfW* z`r15(d)n#dwY)yPJb$D^w4>uORWXUY+pNAf)9#{?009C72oNAZfB*pk1PBl)RG><2 zuNN>Yv`%FaAV7cs0RjXF5FkK+009D>z~rnKuxvJseF2^f0t5&UAV7cs0RjXF5Fk*t z!1SUQU|&Gl_gi%Y2oNAZfB*pk1PBlyK%k9YK#u&)fRwhq_XXyMYX$-Y2oNAZfB*pk z1PBlyK%i8C>Y^8LUuvQ1B0zuu0RjXF5FkK+009C74g!<2UO@hKfPDcT3<3lQ5FkK+ z009C72oNApw!rkF7hqpN+4oy@1PBlyK!5-N0t5&UAV46cT^$NJPq9ej+r@tW_qf~t z*3l~Ha(6s#2X)Hx@k5<{BGd3Kes~pm6S;1_-al8%*(m1A)#)rw+F=Yi29akg=e?El P6#sFMSLRjMk*D|v8{;;( literal 0 HcmV?d00001 diff --git a/tests/linkage_asm/expected/output-alf_105.alf b/tests/linkage_asm/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..9b4e4d3e9b37fb6648dd2160853fe291f3457fb3 GIT binary patch literal 33068 zcmeI*F-`(O6adh{U}C5UC*T0a09tITg$;#?H`oNCCSpZlxo~7-VTXTMNR~aq`6%YA_4z6;nqhRg4cei*dU3IO Rk>Y<2^6I?uy0as1{0BGjHo^b^ literal 0 HcmV?d00001 diff --git a/tests/linkage_asm/expected/output-ar.txt b/tests/linkage_asm/expected/output-ar.txt new file mode 100644 index 0000000..abedb5e --- /dev/null +++ b/tests/linkage_asm/expected/output-ar.txt @@ -0,0 +1,14 @@ +04000000 00000000 +04000004 00000000 +04000008 4B00122C +0400000C 4BFFFFF8 +04000010 4182FFF4 +04000014 38008100 +04000018 38008100 +0400001C 38008200 +04000020 38008100 +04000024 38008101 +04000028 38008200 +0400002C 38001234 +04000030 3800F234 +04000034 38000004 \ No newline at end of file diff --git a/tests/linkage_asm/expected/output-code.bin b/tests/linkage_asm/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..0637aa19f8c75226556b54720a302b6ec8ea4af5 GIT binary patch literal 56 tcmZQzfBAsz4k|9?0({r_UY(8vJ6O;Ea#(SiZQ7BaD5_yoiZEC7QK4DtW~ literal 0 HcmV?d00001 diff --git a/tests/linkage_asm/expected/output-dolphin.ini b/tests/linkage_asm/expected/output-dolphin.ini new file mode 100644 index 0000000..ba55cae --- /dev/null +++ b/tests/linkage_asm/expected/output-dolphin.ini @@ -0,0 +1,14 @@ +0x82000000:dword:0x00000000 +0x82000004:dword:0x00000000 +0x82000008:dword:0x4B00122C +0x8200000C:dword:0x4BFFFFF8 +0x82000010:dword:0x4182FFF4 +0x82000014:dword:0x38008100 +0x82000018:dword:0x38008100 +0x8200001C:dword:0x38008200 +0x82000020:dword:0x38008100 +0x82000024:dword:0x38008101 +0x82000028:dword:0x38008200 +0x8200002C:dword:0x38001234 +0x82000030:dword:0x3800F234 +0x82000034:dword:0x38000004 \ No newline at end of file diff --git a/tests/linkage_asm/expected/output-gecko.txt b/tests/linkage_asm/expected/output-gecko.txt new file mode 100644 index 0000000..054aefd --- /dev/null +++ b/tests/linkage_asm/expected/output-gecko.txt @@ -0,0 +1,8 @@ +06000000 00000038 +00000000 00000000 +4B00122C 4BFFFFF8 +4182FFF4 38008100 +38008100 38008200 +38008100 38008101 +38008200 38001234 +3800F234 38000004 \ No newline at end of file diff --git a/tests/linkage_asm/expected/output-kamek.Base.bin b/tests/linkage_asm/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..cdc4beca8c91c42f836f1b4463bc31dcb35323f2 GIT binary patch literal 120 zcmeZH%uUT^U|?c^01F@m!%!gz-v9sr literal 0 HcmV?d00001 diff --git a/tests/linkage_asm/expected/output-map-dynamic.map b/tests/linkage_asm/expected/output-map-dynamic.map new file mode 100644 index 0000000..f770902 --- /dev/null +++ b/tests/linkage_asm/expected/output-map-dynamic.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 00000000 000000 _f_init + 00000000 000000 _e_init + 00000000 000000 _f_text + 00000038 000000 __ctor_loc + 00000038 000000 __ctor_end + 00000038 000000 _e_text + 00000038 000000 _f_ctors + 00000038 000000 _e_ctors + 00000038 000000 _f_dtors + 00000038 000000 _e_dtors + 00000038 000000 _f_rodata + 00000038 000000 _e_rodata + 00000038 000000 _f_data + 00000038 000000 _e_data diff --git a/tests/linkage_asm/expected/output-map-static.map b/tests/linkage_asm/expected/output-map-static.map new file mode 100644 index 0000000..499086d --- /dev/null +++ b/tests/linkage_asm/expected/output-map-static.map @@ -0,0 +1,16 @@ +Kamek Binary Map + Offset Size Name + 82000000 000000 _f_init + 82000000 000000 _e_init + 82000000 000000 _f_text + 82000038 000000 __ctor_loc + 82000038 000000 __ctor_end + 82000038 000000 _e_text + 82000038 000000 _f_ctors + 82000038 000000 _e_ctors + 82000038 000000 _f_dtors + 82000038 000000 _e_dtors + 82000038 000000 _f_rodata + 82000038 000000 _e_rodata + 82000038 000000 _f_data + 82000038 000000 _e_data diff --git a/tests/linkage_asm/expected/output-riiv.xml b/tests/linkage_asm/expected/output-riiv.xml new file mode 100644 index 0000000..6dad161 --- /dev/null +++ b/tests/linkage_asm/expected/output-riiv.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/linkage_asm/externals.txt b/tests/linkage_asm/externals.txt new file mode 100644 index 0000000..43554d7 --- /dev/null +++ b/tests/linkage_asm/externals.txt @@ -0,0 +1,2 @@ +externalSym1=0x81001234 +externalSym2=0x8100f234 \ No newline at end of file diff --git a/tests/linkage_asm/test.S b/tests/linkage_asm/test.S new file mode 100644 index 0000000..8f416fe --- /dev/null +++ b/tests/linkage_asm/test.S @@ -0,0 +1,20 @@ +#include + +.extern externalSym1, externalSym2 +.long 0 +localSym: .long 0 + +localFunc: + b externalSym1 + b localSym + // beq externalSym1 // not possible + beq localSym + li r0, externalSym1@h + li r0, externalSym2@h + li r0, localSym@h + li r0, externalSym1@ha + li r0, externalSym2@ha + li r0, localSym@ha + li r0, externalSym1@l + li r0, externalSym2@l + li r0, localSym@l diff --git a/tests/linkage_cpp/expected/output-alf_104.alf b/tests/linkage_cpp/expected/output-alf_104.alf new file mode 100644 index 0000000000000000000000000000000000000000..59d205d456af628e144e21a1206d26cf1fc67693 GIT binary patch literal 33160 zcmeI*!Ab%_9LMqBYQZ7}tMmZ+0-@$%piUjSEEMzv3Q8TSlLrritGz%_hYp>6mR=$# zdV%oTVf~M*pgzLz9r(}A4zq*v***Q4U2iXMuI{xeS!I1xVhxMa;b1gu7M;`xAbK&00IagfB*srAbJUHx z0R#|0009ILKmY**5Rhgcrr^VMrRz*}J4XKa*2w?HacTY%>E!iCN9W&Cs#-PG;yBIo zuZ!+fu3YO(^3urKkt;9O?V0r}_WhIJ|IxEuo7o)WxIA|aC4TNy)lZw_-B~K42)m|e zM^3(7>o_ee6#Mb^(^RsEEgpMMcMpSpt77f`U~^_C*@0EQL>5~k+dCuMvj0)=BmJmD Hi%nSq^q^O^ literal 0 HcmV?d00001 diff --git a/tests/linkage_cpp/expected/output-alf_105.alf b/tests/linkage_cpp/expected/output-alf_105.alf new file mode 100644 index 0000000000000000000000000000000000000000..05e7962fdf23ddf0e1df3e93fdfe2a65066562b9 GIT binary patch literal 33168 zcmeI*O-jQ+6u|M9Rv{FHw0MB_0@B7V26W}ZO+djDG|-}gy6U2fLeqKyK^HDu_bgsQ zP`rS2>mq%xsgU#t!+&5tGRzE}U$S~k((Ci9i#yq*tg)>n(uU^a@n|yc7M+v`Ab%i*QPX0R$Ys=?Aj$Xdy;Pgu*kybO2)nSt7 zpJ#))xO%HU%WD&D2d=)_wintjq4m#x{w7a4H`6tyVSVX364}~`G(U8WH>aV9BI}%@ z9XPRetM6o`Swb6stG}1y~y^ouoM(kd30PE9gF^#f{nJ3 J`=uE+aSa(DSHJ)O literal 0 HcmV?d00001 diff --git a/tests/linkage_cpp/expected/output-ar.txt b/tests/linkage_cpp/expected/output-ar.txt new file mode 100644 index 0000000..9cd4582 --- /dev/null +++ b/tests/linkage_cpp/expected/output-ar.txt @@ -0,0 +1,39 @@ +04000000 38600000 +04000004 4E800020 +04000008 38600001 +0400000C 4E800020 +04000010 9421FFF0 +04000014 7C0802A6 +04000018 90010014 +0400001C 93E1000C +04000020 3BE00000 +04000024 4B001211 +04000028 4B00F20D +0400002C 4BFFFFDD +04000030 3C608100 +04000034 38031234 +04000038 7FFF0278 +0400003C 3C608101 +04000040 3803F234 +04000044 7FFF0278 +04000048 3C608200 +0400004C 38030008 +04000050 7FFF0278 +04000054 7FE3FB78 +04000058 83E1000C +0400005C 80010014 +04000060 7C0803A6 +04000064 38210010 +04000068 4E800020 +0400006C 4B0011C8 +04000070 4BFFFF98 +04000074 38008100 +04000078 38008100 +0400007C 38008200 +04000080 38008100 +04000084 38008101 +04000088 38008200 +0400008C 38001234 +04000090 3800F234 +04000094 38000008 +04000098 4E800020 \ No newline at end of file diff --git a/tests/linkage_cpp/expected/output-code.bin b/tests/linkage_cpp/expected/output-code.bin new file mode 100644 index 0000000000000000000000000000000000000000..604e482d31d8601e2794c74ce9e69eb902f8f845 GIT binary patch literal 156 zcmcCWU|{fTU{J6~U|9_t4T4BiYvg5C_Dc)kDsziX4w z$Y8-NWK#d1sRGDmv|#=OWj6uE88|@V^^bp7Gz0ZE0L`f3U|wdS$RGeR+nYh~1kj8b d77Rc$z!<0p!e+E!0I`KkEEqlkF#`ukJpireEhqp0 literal 0 HcmV?d00001 diff --git a/tests/linkage_cpp/expected/output-dolphin.ini b/tests/linkage_cpp/expected/output-dolphin.ini new file mode 100644 index 0000000..bf6d295 --- /dev/null +++ b/tests/linkage_cpp/expected/output-dolphin.ini @@ -0,0 +1,39 @@ +0x82000000:dword:0x38600000 +0x82000004:dword:0x4E800020 +0x82000008:dword:0x38600001 +0x8200000C:dword:0x4E800020 +0x82000010:dword:0x9421FFF0 +0x82000014:dword:0x7C0802A6 +0x82000018:dword:0x90010014 +0x8200001C:dword:0x93E1000C +0x82000020:dword:0x3BE00000 +0x82000024:dword:0x4B001211 +0x82000028:dword:0x4B00F20D +0x8200002C:dword:0x4BFFFFDD +0x82000030:dword:0x3C608100 +0x82000034:dword:0x38031234 +0x82000038:dword:0x7FFF0278 +0x8200003C:dword:0x3C608101 +0x82000040:dword:0x3803F234 +0x82000044:dword:0x7FFF0278 +0x82000048:dword:0x3C608200 +0x8200004C:dword:0x38030008 +0x82000050:dword:0x7FFF0278 +0x82000054:dword:0x7FE3FB78 +0x82000058:dword:0x83E1000C +0x8200005C:dword:0x80010014 +0x82000060:dword:0x7C0803A6 +0x82000064:dword:0x38210010 +0x82000068:dword:0x4E800020 +0x8200006C:dword:0x4B0011C8 +0x82000070:dword:0x4BFFFF98 +0x82000074:dword:0x38008100 +0x82000078:dword:0x38008100 +0x8200007C:dword:0x38008200 +0x82000080:dword:0x38008100 +0x82000084:dword:0x38008101 +0x82000088:dword:0x38008200 +0x8200008C:dword:0x38001234 +0x82000090:dword:0x3800F234 +0x82000094:dword:0x38000008 +0x82000098:dword:0x4E800020 \ No newline at end of file diff --git a/tests/linkage_cpp/expected/output-gecko.txt b/tests/linkage_cpp/expected/output-gecko.txt new file mode 100644 index 0000000..c4534b6 --- /dev/null +++ b/tests/linkage_cpp/expected/output-gecko.txt @@ -0,0 +1,21 @@ +06000000 000000A0 +38600000 4E800020 +38600001 4E800020 +9421FFF0 7C0802A6 +90010014 93E1000C +3BE00000 4B001211 +4B00F20D 4BFFFFDD +3C608100 38031234 +7FFF0278 3C608101 +3803F234 7FFF0278 +3C608200 38030008 +7FFF0278 7FE3FB78 +83E1000C 80010014 +7C0803A6 38210010 +4E800020 4B0011C8 +4BFFFF98 38008100 +38008100 38008200 +38008100 38008101 +38008200 38001234 +3800F234 38000008 +4E800020 00000000 \ No newline at end of file diff --git a/tests/linkage_cpp/expected/output-kamek.Base.bin b/tests/linkage_cpp/expected/output-kamek.Base.bin new file mode 100644 index 0000000000000000000000000000000000000000..938bbf0a29874f97a7419459e31410a6bf6159bc GIT binary patch literal 252 zcmXwzF$%&^5JcxEDnTqHcmM?p50GL(4 \ No newline at end of file diff --git a/tests/linkage_cpp/externals.txt b/tests/linkage_cpp/externals.txt new file mode 100644 index 0000000..43554d7 --- /dev/null +++ b/tests/linkage_cpp/externals.txt @@ -0,0 +1,2 @@ +externalSym1=0x81001234 +externalSym2=0x8100f234 \ No newline at end of file diff --git a/tests/linkage_cpp/test.cpp b/tests/linkage_cpp/test.cpp new file mode 100644 index 0000000..32bf347 --- /dev/null +++ b/tests/linkage_cpp/test.cpp @@ -0,0 +1,38 @@ +#include + +extern "C" unsigned int externalSym1(); +extern "C" unsigned int externalSym2(); + +__attribute__ ((noinline)) unsigned int placeholder() { return 0; }; +__attribute__ ((noinline)) unsigned int localSym() { return 1; }; + +unsigned int localFunc() { + unsigned int value = 0; + + externalSym1(); + externalSym2(); + localSym(); + + value ^= (unsigned int)externalSym1; + value ^= (unsigned int)externalSym2; + value ^= (unsigned int)localSym; + + return value; +} + +asm void localFuncAsm() { + b externalSym1 + b localSym + // beq externalSym1 // not possible + // beq localSym // intentionally not allowed in C++, since you can't guarantee + // that the other function will be close enough to fit in a REL14 + li r0, externalSym1@h + li r0, externalSym2@h + li r0, localSym@h + li r0, externalSym1@ha + li r0, externalSym2@ha + li r0, localSym@ha + li r0, externalSym1@l + li r0, externalSym2@l + li r0, localSym@l +} From a3f93296bf2d05cb35b679ce6d6bf8cc0aba12aa Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Tue, 10 Mar 2026 00:40:20 -0400 Subject: [PATCH 07/12] check=True --- tests/run_tests.py | 81 +++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index d08c689..2b7ec97 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -41,47 +41,56 @@ def compile_s(s_path: Path, o_path: Path) -> None: def kamek_static_link(o_files: list[Path], *, static: int, externals: Path, output_dir: Path) -> None: externals_arg = [f'-externals={externals}'] if externals.is_file() else [] - subprocess.run([ - str(KAMEK_EXE), - '-q', - f'-static=0x{static:08x}', - *externals_arg, - f'-output-riiv={output_dir / "output-riiv.xml"}', - f'-output-dolphin={output_dir / "output-dolphin.ini"}', - f'-output-gecko={output_dir / "output-gecko.txt"}', - f'-output-ar={output_dir / "output-ar.txt"}', - f'-output-code={output_dir / "output-code.bin"}', - f'-output-map={output_dir / "output-map-static.map"}', - f'-input-dol=sample.dol', - f'-output-dol={output_dir / "output-dol.dol"}', - f'-input-alf=sample_104.alf', - f'-output-alf={output_dir / "output-alf_104.alf"}', - *(str(o) for o in o_files), - ]) - subprocess.run([ - str(KAMEK_EXE), - '-q', - f'-static=0x{static:08x}', - *externals_arg, - f'-input-alf=sample_105.alf', - f'-output-alf={output_dir / "output-alf_105.alf"}', - *(str(o) for o in o_files), - ]) + subprocess.run( + [ + str(KAMEK_EXE), + '-q', + f'-static=0x{static:08x}', + *externals_arg, + f'-output-riiv={output_dir / "output-riiv.xml"}', + f'-output-dolphin={output_dir / "output-dolphin.ini"}', + f'-output-gecko={output_dir / "output-gecko.txt"}', + f'-output-ar={output_dir / "output-ar.txt"}', + f'-output-code={output_dir / "output-code.bin"}', + f'-output-map={output_dir / "output-map-static.map"}', + f'-input-dol=sample.dol', + f'-output-dol={output_dir / "output-dol.dol"}', + f'-input-alf=sample_104.alf', + f'-output-alf={output_dir / "output-alf_104.alf"}', + *(str(o) for o in o_files), + ], + check=True, + ) + subprocess.run( + [ + str(KAMEK_EXE), + '-q', + f'-static=0x{static:08x}', + *externals_arg, + f'-input-alf=sample_105.alf', + f'-output-alf={output_dir / "output-alf_105.alf"}', + *(str(o) for o in o_files), + ], + check=True, + ) def kamek_dynamic_link(o_files: list[Path], *, externals: Path, versions: Path, output_dir: Path) -> None: externals_arg = [f'-externals={externals}'] if externals.is_file() else [] - subprocess.run([ - str(KAMEK_EXE), - '-q', - '-dynamic', - *externals_arg, - f'-versions={versions}', - f'-output-kamek={output_dir / "output-kamek.$KV$.bin"}', - f'-output-map={output_dir / "output-map-dynamic.map"}', - *(str(o) for o in o_files), - ]) + subprocess.run( + [ + str(KAMEK_EXE), + '-q', + '-dynamic', + *externals_arg, + f'-versions={versions}', + f'-output-kamek={output_dir / "output-kamek.$KV$.bin"}', + f'-output-map={output_dir / "output-map-dynamic.map"}', + *(str(o) for o in o_files), + ], + check=True, + ) def main() -> None: From c0c53e7212a8383a9e4810460e77b8e01374468b Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Tue, 10 Mar 2026 01:45:42 -0400 Subject: [PATCH 08/12] Ignore underscored folders in tests directory --- tests/run_tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/run_tests.py b/tests/run_tests.py index 2b7ec97..1f364f1 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -97,6 +97,8 @@ def main() -> None: for test_dir in Path().iterdir(): if not test_dir.is_dir(): continue + if test_dir.name.startswith('_'): + continue bin_dir = test_dir / '_bin' out_dir = test_dir / '_out' From b924db9cfc710040be77d606b3d30a856cdc6255 Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Tue, 10 Mar 2026 04:19:00 -0400 Subject: [PATCH 09/12] More minor improvements --- tests/run_tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 1f364f1..f690aea 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -94,12 +94,14 @@ def kamek_dynamic_link(o_files: list[Path], *, externals: Path, versions: Path, def main() -> None: - for test_dir in Path().iterdir(): + for test_dir in sorted(Path().iterdir()): if not test_dir.is_dir(): continue if test_dir.name.startswith('_'): continue + print(f'---- {test_dir.name} ----') + bin_dir = test_dir / '_bin' out_dir = test_dir / '_out' From 0d5f8a89cd1e07ce3761a12ceb738dfd346d0159 Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Wed, 11 Mar 2026 05:41:22 -0400 Subject: [PATCH 10/12] Better print() message --- tests/run_tests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index f690aea..f23123a 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -94,6 +94,8 @@ def kamek_dynamic_link(o_files: list[Path], *, externals: Path, versions: Path, def main() -> None: + do_bless = '--bless' in sys.argv + for test_dir in sorted(Path().iterdir()): if not test_dir.is_dir(): continue @@ -135,7 +137,7 @@ def main() -> None: expected_dir = test_dir / 'expected' - if '--bless' in sys.argv: + if do_bless: shutil.rmtree(expected_dir, ignore_errors=True) out_dir.rename(expected_dir) @@ -148,7 +150,10 @@ def main() -> None: if expected_file.read_bytes() != actual_file.read_bytes(): raise ValueError(f'{expected_file} and {actual_file} are different!') - print('All tests passed successfully') + if do_bless: + print('All tests blessed') + else: + print('All tests passed successfully') main() From 58c6b63b5d9b61bf360580596dd3f81c3feefcb2 Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Mon, 16 Mar 2026 04:44:36 -0400 Subject: [PATCH 11/12] Update test output after recent bugfixes --- tests/writes_asm/expected/output-alf_104.alf | Bin 33008 -> 33008 bytes tests/writes_asm/expected/output-alf_105.alf | Bin 33016 -> 33016 bytes tests/writes_asm/expected/output-ar.txt | 6 ++--- tests/writes_asm/expected/output-dolphin.ini | 22 +++++++++--------- tests/writes_asm/expected/output-gecko.txt | 10 ++++---- .../writes_asm/expected/output-kamek.Base.bin | Bin 292 -> 292 bytes tests/writes_asm/expected/output-kamek.V2.bin | Bin 292 -> 292 bytes tests/writes_cpp/expected/output-dolphin.ini | 20 ++++++++-------- 8 files changed, 28 insertions(+), 30 deletions(-) diff --git a/tests/writes_asm/expected/output-alf_104.alf b/tests/writes_asm/expected/output-alf_104.alf index 37553c383f263c60d917f1735e24ecbce2e47270..1999fc1972173db1178e2c57edcdc0030153bc02 100644 GIT binary patch delta 19 bcmey+$n>F+X@d_li$l+uvzr5$7t{g(RuTwu delta 19 acmey+$n>F+X@d_l%UK2nhRp%Y3u*yOMF!dc diff --git a/tests/writes_asm/expected/output-alf_105.alf b/tests/writes_asm/expected/output-alf_105.alf index b97f6b997fb3c24c94a7dfd69a9c66734cb4ca8c..b775c07502bca3ecc57491be03d0f5970a9e8e2f 100644 GIT binary patch delta 19 bcmey-$n>L;X@d_li$l+uvzr5$SJVOkS2_ra delta 19 acmey-$n>L;X@d_l%UK2nhRp%YD{28vZ3glH diff --git a/tests/writes_asm/expected/output-ar.txt b/tests/writes_asm/expected/output-ar.txt index 08bc424..b624d0f 100644 --- a/tests/writes_asm/expected/output-ar.txt +++ b/tests/writes_asm/expected/output-ar.txt @@ -17,13 +17,13 @@ 02000110 00004444 08000120 00000055 00000120 00000066 -08000130 40F66666 -00000130 410CCCCD +0C000130 40F66666 +04000130 410CCCCD 04000200 80000204 04000210 81000000 04000220 82000000 04000300 11111111 02000310 00002222 00000320 00000033 -00000330 408CCCCD +04000330 408CCCCD 04000340 60000000 \ No newline at end of file diff --git a/tests/writes_asm/expected/output-dolphin.ini b/tests/writes_asm/expected/output-dolphin.ini index faf780c..fa1d61e 100644 --- a/tests/writes_asm/expected/output-dolphin.ini +++ b/tests/writes_asm/expected/output-dolphin.ini @@ -1,19 +1,19 @@ 0x82000000:dword:0x00000000 -0x80000000:dword:0x80000008 -0x80000010:dword:0x81000000 -0x80000020:dword:0x82000000 -0x80000030:dword:0x80000038 -0x80000040:dword:0x81000000 -0x80000050:dword:0x82000000 -0x80000100:dword:0x22222222 -0x80000110:word:0x00004444 -0x80000120:byte:0x00000066 -0x80000130:byte:0x000000410CCCCD +0x80000000:dword:0x80000008:0x80000004 +0x80000010:dword:0x81000000:0x80000014 +0x80000020:dword:0x82000000:0x80000024 +0x80000030:dword:0x80000038:0x81000000 +0x80000040:dword:0x81000000:0x81000000 +0x80000050:dword:0x82000000:0x81000000 +0x80000100:dword:0x22222222:0x11111111 +0x80000110:word:0x00004444:0x00003333 +0x80000120:byte:0x00000066:0x00000055 +0x80000130:dword:0x410CCCCD:0x40F66666 0x80000200:dword:0x80000204 0x80000210:dword:0x81000000 0x80000220:dword:0x82000000 0x80000300:dword:0x11111111 0x80000310:word:0x00002222 0x80000320:byte:0x00000033 -0x80000330:byte:0x000000408CCCCD +0x80000330:dword:0x408CCCCD 0x80000340:dword:0x60000000 \ No newline at end of file diff --git a/tests/writes_asm/expected/output-gecko.txt b/tests/writes_asm/expected/output-gecko.txt index 8f993d9..51b37ed 100644 --- a/tests/writes_asm/expected/output-gecko.txt +++ b/tests/writes_asm/expected/output-gecko.txt @@ -29,16 +29,14 @@ C0000000 00000004 88030000 2C000055 4082000C 38000066 98030000 4E800020 -C0000000 00000004 -3C608000 60630130 -88030000 6CF66666 -4082000C 790CCCCD -98030000 4E800020 +20000130 40F66666 +04000130 410CCCCD +E2000001 00000000 04000200 80000204 04000210 81000000 04000220 82000000 04000300 11111111 02000310 00002222 00000320 00000033 -00000330 408CCCCD +04000330 408CCCCD 04000340 60000000 \ No newline at end of file diff --git a/tests/writes_asm/expected/output-kamek.Base.bin b/tests/writes_asm/expected/output-kamek.Base.bin index 03cf984d1cc2ef58acffdc377309b0971a1b5b17..5cdd214c0ef07761b72d28919c5147cef8323ac2 100644 GIT binary patch delta 17 ZcmZ3&w1jEG7DkncTf-R@Ci60i0{}Ku1uOsn delta 17 ZcmZ3&w1jEG7Dly+Tf-TZCi60i0{}L11uy^r diff --git a/tests/writes_asm/expected/output-kamek.V2.bin b/tests/writes_asm/expected/output-kamek.V2.bin index 16b1d9c2245ad2f1590b2831e5a030fc520dafc2..5cf2767c3452be862a786c17add0a66e69feddec 100644 GIT binary patch delta 17 ZcmZ3&w1jEG7DkncTf-R@Ci60i0{}Ku1uOsn delta 17 ZcmZ3&w1jEG7Dly+Tf-TZCi60i0{}L11uy^r diff --git a/tests/writes_cpp/expected/output-dolphin.ini b/tests/writes_cpp/expected/output-dolphin.ini index 089308a..8006b7a 100644 --- a/tests/writes_cpp/expected/output-dolphin.ini +++ b/tests/writes_cpp/expected/output-dolphin.ini @@ -1,13 +1,13 @@ -0x80000000:dword:0x80000008 -0x80000010:dword:0x81000000 -0x80000020:dword:0x82000000 -0x80000030:dword:0x80000038 -0x80000040:dword:0x81000000 -0x80000050:dword:0x82000000 -0x80000100:dword:0x22222222 -0x80000110:word:0x00004444 -0x80000120:byte:0x00000066 -0x80000130:dword:0x410CCCCD +0x80000000:dword:0x80000008:0x80000004 +0x80000010:dword:0x81000000:0x80000014 +0x80000020:dword:0x82000000:0x80000024 +0x80000030:dword:0x80000038:0x81000000 +0x80000040:dword:0x81000000:0x81000000 +0x80000050:dword:0x82000000:0x81000000 +0x80000100:dword:0x22222222:0x11111111 +0x80000110:word:0x00004444:0x00003333 +0x80000120:byte:0x00000066:0x00000055 +0x80000130:dword:0x410CCCCD:0x40F66666 0x80000200:dword:0x80000204 0x80000210:dword:0x81000000 0x80000220:dword:0x82000000 From 7807d3519f63783ffdd60c48303ee5ad36204860 Mon Sep 17 00:00:00 2001 From: RoadrunnerWMC Date: Mon, 16 Mar 2026 04:48:44 -0400 Subject: [PATCH 12/12] Add tests for kmCondWriteNop --- tests/writes_asm/expected/output-ar.txt | 2 ++ tests/writes_asm/expected/output-dolphin.ini | 1 + tests/writes_asm/expected/output-gecko.txt | 3 +++ tests/writes_asm/expected/output-kamek.Base.bin | Bin 292 -> 308 bytes tests/writes_asm/expected/output-kamek.V2.bin | Bin 292 -> 308 bytes tests/writes_asm/expected/output-riiv.xml | 1 + tests/writes_asm/test.S | 1 + tests/writes_cpp/expected/output-ar.txt | 2 ++ tests/writes_cpp/expected/output-dolphin.ini | 1 + tests/writes_cpp/expected/output-gecko.txt | 3 +++ tests/writes_cpp/expected/output-kamek.Base.bin | Bin 288 -> 304 bytes tests/writes_cpp/expected/output-kamek.V2.bin | Bin 288 -> 304 bytes tests/writes_cpp/expected/output-riiv.xml | 1 + tests/writes_cpp/test.cpp | 1 + 14 files changed, 16 insertions(+) diff --git a/tests/writes_asm/expected/output-ar.txt b/tests/writes_asm/expected/output-ar.txt index b624d0f..4340257 100644 --- a/tests/writes_asm/expected/output-ar.txt +++ b/tests/writes_asm/expected/output-ar.txt @@ -19,6 +19,8 @@ 00000120 00000066 0C000130 40F66666 04000130 410CCCCD +0C000140 99999999 +04000140 60000000 04000200 80000204 04000210 81000000 04000220 82000000 diff --git a/tests/writes_asm/expected/output-dolphin.ini b/tests/writes_asm/expected/output-dolphin.ini index fa1d61e..db1f04a 100644 --- a/tests/writes_asm/expected/output-dolphin.ini +++ b/tests/writes_asm/expected/output-dolphin.ini @@ -9,6 +9,7 @@ 0x80000110:word:0x00004444:0x00003333 0x80000120:byte:0x00000066:0x00000055 0x80000130:dword:0x410CCCCD:0x40F66666 +0x80000140:dword:0x60000000:0x99999999 0x80000200:dword:0x80000204 0x80000210:dword:0x81000000 0x80000220:dword:0x82000000 diff --git a/tests/writes_asm/expected/output-gecko.txt b/tests/writes_asm/expected/output-gecko.txt index 51b37ed..0ad4379 100644 --- a/tests/writes_asm/expected/output-gecko.txt +++ b/tests/writes_asm/expected/output-gecko.txt @@ -32,6 +32,9 @@ C0000000 00000004 20000130 40F66666 04000130 410CCCCD E2000001 00000000 +20000140 99999999 +04000140 60000000 +E2000001 00000000 04000200 80000204 04000210 81000000 04000220 82000000 diff --git a/tests/writes_asm/expected/output-kamek.Base.bin b/tests/writes_asm/expected/output-kamek.Base.bin index 5cdd214c0ef07761b72d28919c5147cef8323ac2..9bf9c71f35577602878ed2375c482330bbdd52ba 100644 GIT binary patch delta 26 gcmZ3&w1sKH5doF||Nk{GFgheKFfhynf{8~G0F;dj8vp + diff --git a/tests/writes_asm/test.S b/tests/writes_asm/test.S index 32a2bdd..7d5d4e9 100644 --- a/tests/writes_asm/test.S +++ b/tests/writes_asm/test.S @@ -14,6 +14,7 @@ kmCondWrite32 0x80000100, 0x11111111, 0x22222222 kmCondWrite16 0x80000110, 0x3333, 0x4444 kmCondWrite8 0x80000120, 0x55, 0x66 kmCondWriteFloat 0x80000130, 7.7, 8.8 +kmCondWriteNop 0x80000140, 0x99999999 kmWritePointer 0x80000200, 0x80000204 kmWritePointer 0x80000210, externalSym diff --git a/tests/writes_cpp/expected/output-ar.txt b/tests/writes_cpp/expected/output-ar.txt index c17c2d6..c37c22c 100644 --- a/tests/writes_cpp/expected/output-ar.txt +++ b/tests/writes_cpp/expected/output-ar.txt @@ -18,6 +18,8 @@ 00000120 00000066 0C000130 40F66666 04000130 410CCCCD +0C000140 99999999 +04000140 60000000 04000200 80000204 04000210 81000000 04000220 82000000 diff --git a/tests/writes_cpp/expected/output-dolphin.ini b/tests/writes_cpp/expected/output-dolphin.ini index 8006b7a..dc393b7 100644 --- a/tests/writes_cpp/expected/output-dolphin.ini +++ b/tests/writes_cpp/expected/output-dolphin.ini @@ -8,6 +8,7 @@ 0x80000110:word:0x00004444:0x00003333 0x80000120:byte:0x00000066:0x00000055 0x80000130:dword:0x410CCCCD:0x40F66666 +0x80000140:dword:0x60000000:0x99999999 0x80000200:dword:0x80000204 0x80000210:dword:0x81000000 0x80000220:dword:0x82000000 diff --git a/tests/writes_cpp/expected/output-gecko.txt b/tests/writes_cpp/expected/output-gecko.txt index 6e46277..6205432 100644 --- a/tests/writes_cpp/expected/output-gecko.txt +++ b/tests/writes_cpp/expected/output-gecko.txt @@ -30,6 +30,9 @@ C0000000 00000004 20000130 40F66666 04000130 410CCCCD E2000001 00000000 +20000140 99999999 +04000140 60000000 +E2000001 00000000 04000200 80000204 04000210 81000000 04000220 82000000 diff --git a/tests/writes_cpp/expected/output-kamek.Base.bin b/tests/writes_cpp/expected/output-kamek.Base.bin index ad7b3b73cf3fa66dcfe721f548c7cdb0ef2f10ca..f9b8556d0163784a72bd8fdccbf2317c65b3dda5 100644 GIT binary patch delta 26 gcmZ3$w1H{D0Rff&|Nk{GFgheKFfhynf{6zb0F!A83jhEB delta 9 QcmdnMw18>Cfr%Fq02DX`W&i*H diff --git a/tests/writes_cpp/expected/output-kamek.V2.bin b/tests/writes_cpp/expected/output-kamek.V2.bin index 2c8fc30466c36c839cffbe2521e4b9d41018a6d6..076e6dfe9b7a4d0825a243fd46b0e869c00ee0d8 100644 GIT binary patch delta 26 gcmZ3$w1H{D0Rff&|Nk{GFgheKFfhynf{6zb0F!A83jhEB delta 9 QcmdnMw18>Cfr%Fq02DX`W&i*H diff --git a/tests/writes_cpp/expected/output-riiv.xml b/tests/writes_cpp/expected/output-riiv.xml index e5307e0..8169f32 100644 --- a/tests/writes_cpp/expected/output-riiv.xml +++ b/tests/writes_cpp/expected/output-riiv.xml @@ -8,6 +8,7 @@ + diff --git a/tests/writes_cpp/test.cpp b/tests/writes_cpp/test.cpp index 044fb13..d6cd6f2 100644 --- a/tests/writes_cpp/test.cpp +++ b/tests/writes_cpp/test.cpp @@ -14,6 +14,7 @@ kmCondWrite32(0x80000100, 0x11111111, 0x22222222); kmCondWrite16(0x80000110, 0x3333, 0x4444); kmCondWrite8(0x80000120, 0x55, 0x66); kmCondWriteFloat(0x80000130, 7.7f, 8.8f); +kmCondWriteNop(0x80000140, 0x99999999); kmWritePointer(0x80000200, 0x80000204); kmWritePointer(0x80000210, &externalSym);