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.
35 lines
751 B
35 lines
751 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
|
|
%t4 = alloca i32
|
|
%t5 = alloca i32
|
|
br label %bbt0
|
|
bbt0:
|
|
store i32 0, i32* %t2
|
|
store i32 0, i32* %t3
|
|
store i32 0, i32* %t4
|
|
store i32 0, i32* %t5
|
|
store i32 10, i32* %t2
|
|
store i32 4, i32* %t3
|
|
store i32 2, i32* %t4
|
|
store i32 2, i32* %t5
|
|
%t6 = load i32, i32* %t4
|
|
%t7 = load i32, i32* %t2
|
|
%t8 = add i32 %t6, %t7
|
|
%t9 = load i32, i32* %t3
|
|
%t10 = load i32, i32* %t5
|
|
%t11 = sub i32 %t9, %t10
|
|
%t12 = mul i32 %t8, %t11
|
|
ret i32 %t12
|
|
}
|