Add tests

This commit is contained in:
Jeehoon Kang
2020-06-09 14:45:11 +00:00
parent ea97330e03
commit ea9e6afcf8
258 changed files with 149921 additions and 26 deletions

31
examples/ir4/switch.ir Normal file
View File

@@ -0,0 +1,31 @@
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
switch 1:i32 default b4() [
0:i32 b2()
1:i32 b3()
]
block b1:
%b1:p0:i32:b
%b1:i0:u1 = cmp eq %b1:p0:i32 2:i32
%b1:i1:i32 = typecast %b1:i0:u1 to i32
ret %b1:i1:i32
block b2:
%b2:i0:i32 = add 0:i32 1:i32
j b1(%b2:i0:i32)
block b3:
%b3:i0:i32 = add 0:i32 2:i32
j b1(%b3:i0:i32)
block b4:
%b4:i0:i32 = add 0:i32 3:i32
j b1(%b4:i0:i32)
}