def FilterKnownValgrindTestFailures(tests):
    (rc, output) = util.getstatusoutput('valgrind --version')
    if (rc != 0):
        util.abort('Failed to get the Valgrind version.')
    version = re.search('^valgrind-([0-9]+)\\.([0-9]+)\\.([0-9]+)', output)
    if (not version):
        util.abort('Failed to get the Valgrind version.')
    major = int(version.group(1))
    minor = int(version.group(2))
    if ((major > 3) or ((major == 3) and (minor > 10))):
        return tests
    reason = 'Valgrind versions before 3.11 have issues with fused multiply-add, so disable the affected tests.'
    known_valgrind_test_failures = {'AARCH64_SIM_fmadd_d', 'AARCH64_SIM_fmadd_s', 'AARCH64_SIM_fmla_2D', 'AARCH64_SIM_fmla_2D_2D_D', 'AARCH64_SIM_fmla_2S', 'AARCH64_SIM_fmla_2S_2S_S', 'AARCH64_SIM_fmla_4S', 'AARCH64_SIM_fmla_4S_4S_S', 'AARCH64_SIM_fmla_D_D_D', 'AARCH64_SIM_fmls_2D', 'AARCH64_SIM_fmls_2D_2D_D', 'AARCH64_SIM_fmls_2S', 'AARCH64_SIM_fmls_2S_2S_S', 'AARCH64_SIM_fmls_4S', 'AARCH64_SIM_fmls_4S_4S_S', 'AARCH64_SIM_fmls_D_D_D', 'AARCH64_SIM_fmsub_d', 'AARCH64_SIM_fmsub_s', 'AARCH64_SIM_fnmadd_d', 'AARCH64_SIM_fnmadd_s', 'AARCH64_SIM_fnmsub_d', 'AARCH64_SIM_fnmsub_s', 'AARCH64_SIM_frecps_2D', 'AARCH64_SIM_frecps_D', 'AARCH64_SIM_frsqrts_2D', 'AARCH64_SIM_frsqrts_D'}
    filtered_list = [x for x in tests if (x not in known_valgrind_test_failures)]
    return (filtered_list, (len(tests) - len(filtered_list)), reason)
def FilterKnownValgrindTestFailures(tests):
    (rc, output) = util.getstatusoutput('valgrind --version')
    if (rc != 0):
        util.abort('Failed to get the Valgrind version.')
    version = re.search('^valgrind-([0-9]+)\\.([0-9]+)\\.([0-9]+)', output)
    if (not version):
        util.abort('Failed to get the Valgrind version.')
    major = int(version.group(1))
    minor = int(version.group(2))
    if ((major > 3) or ((major == 3) and (minor > 10))):
        return tests
    reason = 'Valgrind versions before 3.11 have issues with fused multiply-add, so disable the affected tests.'
    known_valgrind_test_failures = {'AARCH64_SIM_fmadd_d', 'AARCH64_SIM_fmadd_s', 'AARCH64_SIM_fmla_2D', 'AARCH64_SIM_fmla_2D_2D_D', 'AARCH64_SIM_fmla_2S', 'AARCH64_SIM_fmla_2S_2S_S', 'AARCH64_SIM_fmla_4S', 'AARCH64_SIM_fmla_4S_4S_S', 'AARCH64_SIM_fmla_D_D_D', 'AARCH64_SIM_fmls_2D', 'AARCH64_SIM_fmls_2D_2D_D', 'AARCH64_SIM_fmls_2S', 'AARCH64_SIM_fmls_2S_2S_S', 'AARCH64_SIM_fmls_4S', 'AARCH64_SIM_fmls_4S_4S_S', 'AARCH64_SIM_fmls_D_D_D', 'AARCH64_SIM_fmsub_d', 'AARCH64_SIM_fmsub_s', 'AARCH64_SIM_fnmadd_d', 'AARCH64_SIM_fnmadd_s', 'AARCH64_SIM_fnmsub_d', 'AARCH64_SIM_fnmsub_s', 'AARCH64_SIM_frecps_2D', 'AARCH64_SIM_frecps_D', 'AARCH64_SIM_frsqrts_2D', 'AARCH64_SIM_frsqrts_D'}
    filtered_list = [x for x in tests if (x not in known_valgrind_test_failures)]
    return (filtered_list, (len(tests) - len(filtered_list)), reason)