Skip to content

Commit

Permalink
transforms.artiq_ir_generator: add tests for devirtualization.
Browse files Browse the repository at this point in the history
whitequark committed Oct 8, 2015
1 parent 0bb7931 commit b6c8c9f
Showing 2 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lit-test/test/devirtualization/ddb.pyon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"comm": {
"type": "local",
"module": "artiq.coredevice.comm_dummy",
"class": "Comm",
"arguments": {}
}
}
22 changes: 22 additions & 0 deletions lit-test/test/devirtualization/function.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# RUN: env ARTIQ_DUMP_IR=1 %python -m artiq.compiler.testbench.embedding +compile %s 2>%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
from artiq.language.types import *

# CHECK-L: call ()->NoneType %local.testbench.entrypoint ; calls testbench.entrypoint

@kernel
def baz():
pass

class foo:
@kernel
def bar(self):
# CHECK-L: call ()->NoneType %local.testbench.baz ; calls testbench.baz
baz()
x = foo()

@kernel
def entrypoint():
x.bar()

0 comments on commit b6c8c9f

Please sign in to comment.