Files
c3c/test/test_suite/asm/asm_load_rv.c3t
Chuck Benedict e1bbab3831 RISCV: Correct auipc imm; clarify signed imm error; add imm negative t… (#1378)
RISCV: Correct auipc imm; claify signed imm error; add imm negative tests. Allow fitted int asm imm const in uints; add rv regs
2024-08-25 11:19:30 +02:00

21 lines
427 B
Plaintext

// #target: elf-riscv32
module test;
fn void main(String[] args)
{
int x = 2;
asm
{
li $s1, -2147483648;
lui $t0, 123456u;
auipc $x15, 123456u;
auipc $a0, 1;
mv $a0, $a1;
lw $a4, [&x];
lb $a5, [$a7 - 4];
}
}
/* #expect: test.ll
"li s1, -2147483648\0Alui t0, 123456\0Aauipc x15, 123456\0Aauipc a0, 1\0Amv a0, a1\0Alw a4, $0\0Alb a5, -4(a7)\0A", "*m,~{x5},~{x9},~{x10},~{x14},~{x15}"(ptr elementtype(i32) %x)