forked from M-Labs/artiq
compiler: restore exception ids used
This commit is contained in:
parent
70c2ca58af
commit
89f75c989c
@ -61,6 +61,7 @@ class EmbeddingMap:
|
||||
# The exceptions declared here must be defined in `artiq.coredevice.exceptions`
|
||||
# Verify synchronization by running the test cases in `artiq.test.coredevice.test_exceptions`
|
||||
self.preallocate_runtime_exception_names([
|
||||
"0:RuntimeError",
|
||||
"RTIOUnderflow",
|
||||
"RTIOOverflow",
|
||||
"RTIODestinationUnreachable",
|
||||
@ -68,19 +69,9 @@ class EmbeddingMap:
|
||||
"I2CError",
|
||||
"CacheError",
|
||||
"SPIError",
|
||||
|
||||
"0:AssertionError",
|
||||
"0:AttributeError",
|
||||
"0:ZeroDivisionError",
|
||||
"0:IndexError",
|
||||
"0:IOError",
|
||||
"0:KeyError",
|
||||
"0:NotImplementedError",
|
||||
"0:OverflowError",
|
||||
"0:RuntimeError",
|
||||
"0:TimeoutError",
|
||||
"0:TypeError",
|
||||
"0:ValueError",
|
||||
"0:ZeroDivisionError"
|
||||
"UnwrapNoneError",
|
||||
])
|
||||
|
||||
def preallocate_runtime_exception_names(self, names):
|
||||
|
@ -8,7 +8,7 @@ def catch(f):
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# CHECK-L: 18(0, 0, 0)
|
||||
# CHECK-L: 8(0, 0, 0)
|
||||
catch(lambda: 1/0)
|
||||
# CHECK-L: 9(10, 1, 0)
|
||||
catch(lambda: [1.0][10])
|
||||
|
@ -10,7 +10,7 @@ def catch(f):
|
||||
except IndexError as ie:
|
||||
print(ie)
|
||||
|
||||
# CHECK-L: 18(0, 0, 0)
|
||||
# CHECK-L: 8(0, 0, 0)
|
||||
catch(lambda: 1/0)
|
||||
# CHECK-L: 9(10, 1, 0)
|
||||
catch(lambda: [1.0][10])
|
||||
|
@ -3,7 +3,7 @@
|
||||
# REQUIRES: exceptions
|
||||
|
||||
def f():
|
||||
# CHECK-L: Uncaught 18
|
||||
# CHECK-L: Uncaught 8
|
||||
# CHECK-L: at input.py:${LINE:+1}:
|
||||
1/0
|
||||
|
||||
|
@ -9,7 +9,7 @@ def g():
|
||||
try:
|
||||
f()
|
||||
except Exception as e:
|
||||
# CHECK-L: Uncaught 18
|
||||
# CHECK-L: Uncaught 8
|
||||
# CHECK-L: at input.py:${LINE:+1}:
|
||||
raise e
|
||||
|
||||
|
@ -2,6 +2,6 @@
|
||||
# RUN: OutputCheck %s --file-to-check=%t
|
||||
# REQUIRES: exceptions
|
||||
|
||||
# CHECK-L: Uncaught 18: cannot divide by zero (0, 0, 0)
|
||||
# CHECK-L: Uncaught 8: cannot divide by zero (0, 0, 0)
|
||||
# CHECK-L: at input.py:${LINE:+1}:
|
||||
1/0
|
||||
|
Loading…
Reference in New Issue
Block a user