(self)
| 164 | assert_has_error(fn, FnError(source=assign, desc="Func has a duplicate op")) |
| 165 | |
| 166 | def test_pprint(self) -> None: |
| 167 | block_1 = self.basic_block([Return(value=NONE_VALUE)]) |
| 168 | goto = Goto(label=block_1) |
| 169 | block_2 = self.basic_block([goto]) |
| 170 | fn = FuncIR( |
| 171 | decl=self.func_decl(name="func_1"), |
| 172 | arg_regs=[], |
| 173 | # block_1 omitted |
| 174 | blocks=[block_2], |
| 175 | ) |
| 176 | errors = [(goto, "Invalid control operation target: 1")] |
| 177 | formatted = format_func(fn, errors) |
| 178 | assert formatted == [ |
| 179 | "def func_1():", |
| 180 | "L0:", |
| 181 | " \U0000274c goto L1", |
| 182 | " \U0001f446 ERROR: Invalid control operation target: 1", |
| 183 | ] |
| 184 | |
| 185 | def test_load_address_declares_register(self) -> None: |
| 186 | rx = Register(str_rprimitive, "x") |
nothing calls this directly
no test coverage detected