mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 23:18:48 +00:00
Add sizeof examples
This commit is contained in:
37
examples/ir3/sizeof2.ir
Normal file
37
examples/ir3/sizeof2.ir
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
fun i32 @main () {
|
||||
init:
|
||||
bid: b0
|
||||
allocations:
|
||||
|
||||
|
||||
block b0:
|
||||
%b0:i0:u64 = typecast 1:i32 to u64
|
||||
%b0:i1:u1 = cmp eq 1:u64 %b0:i0:u64
|
||||
br %b0:i1:u1, b4(), b5()
|
||||
|
||||
block b1:
|
||||
%b1:i0:u64 = typecast 80:i32 to u64
|
||||
%b1:i1:u1 = cmp eq 80:u64 %b1:i0:u64
|
||||
j b3(%b1:i1:u1)
|
||||
|
||||
block b2:
|
||||
j b3(0:u1)
|
||||
|
||||
block b3:
|
||||
%b3:p0:u1:t1
|
||||
%b3:i0:i32 = typecast %b3:p0:u1 to i32
|
||||
ret %b3:i0:i32
|
||||
|
||||
block b4:
|
||||
%b4:i0:u64 = typecast 4:i32 to u64
|
||||
%b4:i1:u1 = cmp eq 4:u64 %b4:i0:u64
|
||||
j b6(%b4:i1:u1)
|
||||
|
||||
block b5:
|
||||
j b6(0:u1)
|
||||
|
||||
block b6:
|
||||
%b6:p0:u1:t0
|
||||
br %b6:p0:u1, b1(), b2()
|
||||
}
|
||||
Reference in New Issue
Block a user