mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-16 07:28:52 +00:00
Add tests
This commit is contained in:
36
examples/ir2/simple_for.ir
Normal file
36
examples/ir2/simple_for.ir
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
fun i32 @main () {
|
||||
init:
|
||||
bid: b0
|
||||
allocations:
|
||||
%l0:i32:i
|
||||
%l1:i32:sum
|
||||
|
||||
block b0:
|
||||
%b0:i0:unit = nop
|
||||
%b0:i1:unit = nop
|
||||
j b2(0:i32, 0:i32)
|
||||
|
||||
block b2:
|
||||
%b2:p0:i32:i
|
||||
%b2:p1:i32:sum
|
||||
%b2:i0:unit = nop
|
||||
%b2:i1:u1 = cmp lt %b2:p0:i32 11:i32
|
||||
br %b2:i1:u1, b3(), b5()
|
||||
|
||||
block b3:
|
||||
%b3:i0:unit = nop
|
||||
%b3:i1:unit = nop
|
||||
%b3:i2:i32 = add %b2:p1:i32 %b2:p0:i32
|
||||
%b3:i3:unit = nop
|
||||
%b3:i4:unit = nop
|
||||
%b3:i5:i32 = add %b2:p0:i32 1:i32
|
||||
%b3:i6:unit = nop
|
||||
j b2(%b3:i5:i32, %b3:i2:i32)
|
||||
|
||||
block b5:
|
||||
%b5:i0:unit = nop
|
||||
%b5:i1:u1 = cmp eq %b2:p1:i32 55:i32
|
||||
%b5:i2:i32 = typecast %b5:i1:u1 to i32
|
||||
ret %b5:i2:i32
|
||||
}
|
||||
Reference in New Issue
Block a user