Adds examples/1653-platform-asm-global-jit.sx — a module-scope asm { … }
block executed via `sx run` (no `aot`). sx run compiles the module to an
in-memory object (the integrated assembler assembles the `module asm`
into it), then ORC relocates and runs it, so a module-asm symbol IS
resolvable at JIT main execution — the long-assumed "AOT only" limit was
stale. Sibling of 1648 (same feature via AOT). Locks current behavior
(exit 42); no compiler change.
17 lines
320 B
Plaintext
17 lines
320 B
Plaintext
|
|
module asm ".global _my_sub"
|
|
module asm "_my_sub:"
|
|
module asm " sub x0, x0, x1"
|
|
module asm " ret"
|
|
|
|
; Function Attrs: nounwind
|
|
declare i64 @my_sub(i64, i64) #0
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @main() #0 {
|
|
entry:
|
|
%call = call i64 @my_sub(i64 44, i64 2)
|
|
%ca.tr = trunc i64 %call to i32
|
|
ret i32 %ca.tr
|
|
}
|