Files
ivy/doc/sample/Match.mie

48 lines
847 B
Plaintext
Raw Permalink Normal View History

define void @init() static {
entry:
%age = alloca id
store i32 #65, ptr %age
%yz = alloca id
store i32 #32, ptr %yz
%p3 = alloca id
store i32 #3, ptr %p3
%1 = load id, ptr %yz
%2 = load id, ptr %p3
switch id %1, label %match.d,
[ i32 #1, label %match.0 ],
[ i32 #2, label %match.1 ],
[ i32 %2, label %match.2 ]
match.0:
%wq = alloca id
store i32 #32, ptr %wq
%3 = load id, ptr %wq
%multmp = mul id %3, i32 #2
br label %match.end
match.1:
%4 = load id, ptr %age
%divtmp = mul id %4, i32 #12
br label %match.end
match.2:
%5 = load id, ptr %age
%divtmp.0 = mul id %5, i32 #365
br label %match.end
match.d:
br label %match.end
match.end:
%match.result = phi id
[ %match.0, %multmp],
[ %match.1, %divtmp ],
[ %match.2, %divtmp.0 ],
[ %match.d, #0 ]
%q = alloca id
store id %match.result, ptr %q
ret void
}