forked from NUDT-compiler/nudt-compiler-cpp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
530 B
26 lines
530 B
declare i32 @getint()
|
|
declare i32 @getch()
|
|
declare void @putint(i32)
|
|
declare void @putch(i32)
|
|
declare i32 @getarray(i32*)
|
|
declare void @putarray(i32, i32*)
|
|
declare void @starttime()
|
|
declare void @stoptime()
|
|
define i32 @main() {
|
|
entry:
|
|
%t1 = alloca i32
|
|
%t2 = alloca i32
|
|
%t3 = alloca i32
|
|
br label %bbt0
|
|
bbt0:
|
|
store i32 0, i32* %t2
|
|
store i32 0, i32* %t3
|
|
store i32 10, i32* %t2
|
|
%t4 = sub i32 0, 1
|
|
store i32 %t4, i32* %t3
|
|
%t5 = load i32, i32* %t2
|
|
%t6 = load i32, i32* %t3
|
|
%t7 = add i32 %t5, %t6
|
|
ret i32 %t7
|
|
}
|