def METHOD_NAME(debug_last_error):
    """Tests debug_last_error"""
    dtype = "int16"
    in_shape = (1, 28, 28, 12)
    pool_size = (3, 3)
    strides = (2, 2)
    padding = "SAME"
    relu_type = "NONE"
    pool_type = relay.nn.avg_pool2d
    zero_point = -34
    scale = 0.0256
    compiler_cpu = "cortex-m55"
    cpu_flags = "+nomve"
    layout = "NHWC"
    input_op = None
    interface_api = "c"
    use_unpacked_api = True
    model = make_model(
        pool_op=pool_type,
        shape=in_shape,
        pool_size=pool_size,
        strides=strides,
        padding=padding,
        dtype=dtype,
        scale=scale,
        zero_point=zero_point,
        relu_type=relu_type,
        layout=layout,
        input_op=input_op,
    )
    orig_mod = make_module(model)
    cmsisnn_mod = cmsisnn.partition_for_cmsisnn(orig_mod)
    # validate pattern matching
    assert_partitioned_function(orig_mod, cmsisnn_mod)
    # validate the output
    in_min, in_max = get_dtype_range(dtype)
    inputs = {
        "input": np.random.randint(in_min, high=in_max, size=in_shape, dtype=dtype),
    }
    output_list = generate_ref_data(orig_mod["main"], inputs)
    def checker(base_path: str) -> bool:
        def read_file(path):
            with open(path) as f:
                return f.read()
        test = read_file(base_path + "/build/test.c")
        test_check = "TVMGetLastError" in test
        default_lib2 = read_file(base_path + "/codegen/host/src/default_lib2.c")
        regex = (
            r"(?s)arm_avgpool_s16(.*?)"
            r'ARM_CMSIS_NN_ARG_ERROR: TVMAPISetLastError\("ARM_CMSIS_NN_ARG_ERROR(.*?)'
            r'ARM_CMSIS_NN_NO_IMPL_ERROR: TVMAPISetLastError\("ARM_CMSIS_NN_NO_IMPL_ERROR'
        )
        default_lib2_check = re.search(regex, default_lib2) is not None
        if debug_last_error:
            return test_check and default_lib2_check
        else:
            return not (test_check or default_lib2_check)
    result = compile_and_run(
        AOTTestModel(
            module=cmsisnn_mod,
            inputs=inputs,
            outputs=output_list,
            params=None,
            output_tolerance=1,
        ),
        create_test_runner(compiler_cpu, cpu_flags, debug_last_error=debug_last_error),
        interface_api,
        use_unpacked_api,
        debug_last_error=debug_last_error,
        checker=checker,
    )
    assert result