artiq/artiq/test/lit/embedding/annotation.py
whitequark 3a1fc729cf compiler: refactor type annotations recognizing in kernels.
The new implementation is much more generic, more robust,
and shares code with the same for syscalls as well as RPCs.

Fixes #713.
2017-04-13 08:26:10 +00:00

18 lines
426 B
Python

# RUN: env ARTIQ_DUMP_LLVM=%t %python -m artiq.compiler.testbench.embedding +compile %s
# RUN: OutputCheck %s --file-to-check=%t.ll
from artiq.language.core import *
from artiq.language.types import *
# CHECK: i64 @_Z13testbench.foozz\(i64 %ARG.x, \{ i1, i64 \} %ARG.y\)
@kernel
def foo(x: TInt64, y: TInt64 = 1) -> TInt64:
print(x+y)
return x+y
@kernel
def entrypoint():
print(foo(0, 2))
print(foo(1, 3))