mirror of
https://github.com/Decompollaborate/rabbitizer.git
synced 2024-12-27 12:16:07 +00:00
Add test
This commit is contained in:
parent
7ecabbd04f
commit
55e7bc12bf
17
tests/c/instruction_checks/get_branch_vram_generic.c
Normal file
17
tests/c/instruction_checks/get_branch_vram_generic.c
Normal 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;
|
||||||
|
}
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user