feat(backend/riscv32): 实现基础的编译器功能
- 完成 RV32IMA 指令集的代码生成 - 添加整数运算、分支、调用等基本指令支持 - 实现从 IR 到机器码的转换 - 添加简单的测试用例和测试框架
This commit is contained in:
12
ccompiler/backend/riscv32/tests/simple/08_do_while.c
Normal file
12
ccompiler/backend/riscv32/tests/simple/08_do_while.c
Normal file
@@ -0,0 +1,12 @@
|
||||
// #include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int i = 0;
|
||||
int pow = 1;
|
||||
do {
|
||||
pow = pow * 2;
|
||||
i = i + 1;
|
||||
} while(i < 7);
|
||||
// printf("%d", pow);
|
||||
return pow;
|
||||
}
|
||||
Reference in New Issue
Block a user