def METHOD_NAME(self):
    """Test that the pass successfully converts instructions nested within control-flow
    blocks."""
    bits = [Clbit()]
    registers = [QuantumRegister(3), ClassicalRegister(2)]
    base = QuantumCircuit(*registers, bits)
    base.x(0).c_if(bits[0], False)
    with base.if_test((base.cregs[0], 0)) as else_:
        base.z(1).c_if(bits[0], False)
    with else_:
        base.z(1).c_if(base.cregs[0], 1)
    with base.for_loop(range(2)):
        with base.while_loop((base.cregs[0], 1)):
            base.cx(1, 2).c_if(base.cregs[0], 1)
    base = canonicalize_control_flow(base)
    expected = QuantumCircuit(*registers, bits)
    with expected.if_test((bits[0], False)):
        expected.x(0)
    with expected.if_test((expected.cregs[0], 0)) as else_:
        with expected.if_test((bits[0], False)):
            expected.z(1)
    with else_:
        with expected.if_test((expected.cregs[0], 1)):
            expected.z(1)
    with expected.for_loop(range(2)):
        with expected.while_loop((expected.cregs[0], 1)):
            with expected.if_test((expected.cregs[0], 1)):
                expected.cx(1, 2)
    expected = canonicalize_control_flow(expected)
    output = PassManager([ConvertConditionsToIfOps()]).run(base)
    self.assertEqual(output, expected)