This commit is contained in:
descawed 2023-12-25 12:38:30 -05:00
parent 7ecabbd04f
commit 55e7bc12bf
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,17 @@
/* SPDX-FileCopyrightText: © 2023 Decompollaborate */
/* SPDX-License-Identifier: MIT */
#include "rabbitizer.h"
#include <stdlib.h>
int main() {
RabbitizerInstruction inst;
RabbitizerInstruction_init(&inst, 0x14600001, 0x80000000); // bnez $v1, . + 4 + (0x1 << 2)
RabbitizerInstruction_processUniqueId(&inst);
if (RabbitizerInstruction_getBranchVramGeneric(&inst) < 0) {
printf("Word '0x%08X' has a negative branch target\n", inst.word);
return 1;
}
return 0;
}

View File

@ -6,6 +6,7 @@
set -e set -e
./build/tests/c/instruction_checks/jalr.elf ./build/tests/c/instruction_checks/jalr.elf
./build/tests/c/instruction_checks/get_branch_vram_generic.elf
./build/tests/c/instruction_checks/plain_disassembly.elf ./build/tests/c/instruction_checks/plain_disassembly.elf
./build/tests/c/instruction_checks/r3000gte_disasm.elf ./build/tests/c/instruction_checks/r3000gte_disasm.elf
./build/tests/c/instruction_checks/r5900_trunc_cvt.elf ./build/tests/c/instruction_checks/r5900_trunc_cvt.elf