Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 082e9e20dd79
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 502e570e867c
Choose a head ref
  • 2 commits
  • 15 files changed
  • 1 contributor

Commits on Dec 25, 2015

  1. Commit missing parts of 082e9e2.

    whitequark committed Dec 25, 2015
    Copy the full SHA
    8051fe9 View commit details
  2. Copy the full SHA
    502e570 View commit details
9 changes: 6 additions & 3 deletions artiq/compiler/embedding.py
Original file line number Diff line number Diff line change
@@ -124,7 +124,10 @@ def quote(self, value):
OrderedDict())
instance_type.attributes['__objectid__'] = builtins.TInt32()

constructor_type = types.TConstructor(instance_type)
if issubclass(typ, BaseException):
constructor_type = types.TExceptionConstructor(instance_type)
else:
constructor_type = types.TConstructor(instance_type)
constructor_type.attributes['__objectid__'] = builtins.TInt32()
instance_type.constructor = constructor_type

@@ -183,15 +186,15 @@ def call(self, function_node, args, kwargs, callback=None):
for kw, value, (arg_loc, equals_loc)
in zip(kwargs, kwarg_nodes, kwarg_locs)],
starargs=None, kwargs=None,
type=types.TVar(), iodelay=None,
type=types.TVar(), iodelay=None, arg_exprs={},
begin_loc=begin_loc, end_loc=end_loc, star_loc=None, dstar_loc=None,
loc=name_loc.join(end_loc))

if callback is not None:
node = asttyped.CallT(
func=callback_node,
args=[node], keywords=[], starargs=None, kwargs=None,
type=builtins.TNone(), iodelay=None,
type=builtins.TNone(), iodelay=None, arg_exprs={},
begin_loc=cb_begin_loc, end_loc=cb_end_loc, star_loc=None, dstar_loc=None,
loc=callback_node.loc.join(cb_end_loc))

8 changes: 8 additions & 0 deletions artiq/compiler/testbench/embedding.py
Original file line number Diff line number Diff line change
@@ -6,6 +6,12 @@
from artiq.coredevice.core import Core, CompileError

def main():
if len(sys.argv) > 1 and sys.argv[1] == "+diag":
del sys.argv[1]
diag = True
else:
diag = False

if len(sys.argv) > 1 and sys.argv[1] == "+compile":
del sys.argv[1]
compile_only = True
@@ -30,6 +36,8 @@ def main():
core.comm.clear_log()
except CompileError as error:
print("\n".join(error.__cause__.diagnostic.render(only_line=True)))
if not diag:
exit(1)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_attr_absent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_attr_absent_suggest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_attr_conflict.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_attr_unify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_name_absent_suggest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_rpc_annot_return.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_rpc_default_unify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_syscall_annot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_syscall_annot_return.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_syscall_arg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_syscall_default_arg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
2 changes: 1 addition & 1 deletion lit-test/test/embedding/error_syscall_return.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

from artiq.language.core import *
12 changes: 12 additions & 0 deletions lit-test/test/embedding/exception.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s

from artiq.language.core import *
from artiq.language.types import *
from artiq.coredevice.exceptions import RTIOUnderflow

@kernel
def entrypoint():
try:
pass
except RTIOUnderflow:
pass