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.
24 lines
458 B
24 lines
458 B
@a = global i32 10
|
|
|
|
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
|
|
br label %bbt0
|
|
bbt0:
|
|
store i32 0, i32* %t2
|
|
store i32 2, i32* %t2
|
|
%t3 = load i32, i32* %t2
|
|
%t4 = load i32, i32* @a
|
|
%t5 = sub i32 %t3, %t4
|
|
ret i32 %t5
|
|
}
|