CS153/hw6/llprograms/funptr.ll
jmug ee01a8f5b2 Change hw6 to an unsolved version.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-24 23:10:01 -08:00

14 lines
240 B
LLVM

define i64 @m(i64 %x) {
%ans = add i64 %x, 1
ret i64 %ans
}
define i64 @apply(i64(i64)* %f) {
%ans = call i64 %f(i64 34)
ret i64 %ans
}
define i64 @main(i64 %argc, i8** %argv) {
%ans = call i64 @apply(i64(i64)* @m)
ret %ans
}