mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-09-11 19:24:18 -04:00
Replaced the default mojo example with a `square` function to align with other examples. Added an explanatory comment on the decorator and abi effect.
5 lines
213 B
Mojo
5 lines
213 B
Mojo
# export + abi("C"): keeps square from being stripped as unused, uses C calling
|
|
# convention (no unbound params), and gives it a clean mangled name.
|
|
@export
|
|
def square(i: Int32) abi("C") -> Int32:
|
|
return i * i |