Skip to content

Commit

Permalink
Added equality assertions for synthetic assignments and synthetic bra…
Browse files Browse the repository at this point in the history
…nching properties
  • Loading branch information
kc611 committed Jul 6, 2023
1 parent 462c716 commit e4dd79c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion numba_rvsdg/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
import yaml

from numba_rvsdg.core.datastructures.scfg import SCFG
from numba_rvsdg.core.datastructures.basic_block import BasicBlock, RegionBlock
from numba_rvsdg.core.datastructures.basic_block import (
BasicBlock,
RegionBlock,
SyntheticBranch,
SyntheticAssignment,
)


class SCFGComparator(TestCase):
Expand Down Expand Up @@ -47,6 +52,15 @@ def assertSCFGEqual(
self.assertSCFGEqual(
node.subregion, second_node.subregion, exiting=node.exiting
)
elif isinstance(node, SyntheticAssignment):
assert (
node.variable_assignment == second_node.variable_assignment
)
elif isinstance(node, SyntheticBranch):
assert (
node.branch_value_table == second_node.branch_value_table
)
assert node.variable == second_node.variable

# Add the jump targets as corresponding nodes in block mapping
# dictionary. Since order must be same we can simply add zip
Expand Down

0 comments on commit e4dd79c

Please sign in to comment.