Esempio n. 1
0
 def testJump(self):
     lines = [Label('f'), Jump('f'), Label('f$exit')]
     cfg = delinearise(lines)
     #self.assertTrue(cfg.has_path(cfg.entry, cfg.entry), msg=cfg)
     self.assertFalse(cfg.has_path(cfg.entry, cfg.exit), msg=cfg)
Esempio n. 2
0
 def testSimple(self):
     lines = [Label('f'), Label('f$exit')]
     cfg = delinearise(lines)
     self.assertEquals(cfg.entry.name, 'f')
     self.assertEquals(cfg.exit.name, 'f$exit')
     self.assertTrue(cfg.has_path(cfg.entry, cfg.exit))
Esempio n. 3
0
 def testSingleLine(self):
     lines = [Label('f'), Instruction(42), Label('f$exit')]
     cfg = delinearise(lines)
     self.assertTrue(cfg.has_path(cfg.entry, Operation(42), cfg.exit),
                     msg=cfg)
Esempio n. 4
0
 def testForwardJump(self):
     lines = [Label('f'), Jump('f2'), Label('f2'), Label('f$exit')]
     cfg = delinearise(lines)
     self.assertTrue(cfg.has_path(cfg.entry, Pass(), cfg.exit), msg=cfg)
Esempio n. 5
0
 def testForwardJump(self):
     lines = [Label('f'), Jump('f2'), Label('f2'), Label('f$exit')]
     cfg = delinearise(lines)
     self.assertTrue(cfg.has_path(cfg.entry, Pass(), cfg.exit), msg=cfg)
Esempio n. 6
0
 def testJump(self):
     lines = [Label('f'), Jump('f'), Label('f$exit')]
     cfg = delinearise(lines)
     #self.assertTrue(cfg.has_path(cfg.entry, cfg.entry), msg=cfg)
     self.assertFalse(cfg.has_path(cfg.entry, cfg.exit), msg=cfg)
Esempio n. 7
0
 def testSingleLine(self):
     lines = [Label('f'), Instruction(42), Label('f$exit')]
     cfg = delinearise(lines)
     self.assertTrue(cfg.has_path(cfg.entry, Operation(42), cfg.exit), msg=cfg)
Esempio n. 8
0
 def testSimple(self):
     lines = [Label('f'), Label('f$exit')]
     cfg = delinearise(lines)
     self.assertEquals(cfg.entry.name, 'f')
     self.assertEquals(cfg.exit.name, 'f$exit')
     self.assertTrue(cfg.has_path(cfg.entry, cfg.exit))