https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117991

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Matthew Malcomson <matma...@gcc.gnu.org>:

https://gcc.gnu.org/g:9335ff73a509a1f203de691052d600facd07c3f8

commit r15-7587-g9335ff73a509a1f203de691052d600facd07c3f8
Author: Matthew Malcomson <mmalcom...@nvidia.com>
Date:   Mon Feb 10 16:24:20 2025 +0000

    gcc: testsuite: Fix builtin-speculation-overloads[14].C testism

    When making warnings trigger a failure in template substitution I
    could not find any way to trigger the warning about builtin speculation
    not being available on the given target.

    Turns out I misread the code -- this warning happens when the
    speculation_barrier pattern is not defined.

    Here we add an effective target to represent
    "__builtin_speculation_safe_value is available on this target" and use
    that to adjust our test on SFINAE behaviour accordingly.
    N.b. this means that we get extra testing -- not just that things work
    on targets which support __builtin_speculation_safe_value, but also that
    the behaviour works on targets which don't support it.

    Tested with AArch64 native, AArch64 cross compiler, and RISC-V cross
    compiler (just running the tests that I've changed).

    Ok for trunk?

    gcc/testsuite/ChangeLog:

            PR target/117991
            * g++.dg/template/builtin-speculation-overloads.def: SUCCESS
            argument in SPECULATION_ASSERTS now uses a macro `true_def`
            instead of the literal `true` for arguments which should work
            with `__builtin_speculation_safe_value`.
            * g++.dg/template/builtin-speculation-overloads1.C: Define
            `true_def` macro on command line to compiler according to the
            effective target representing that
            `__builtin_speculation_safe_value` does something on this
            target.
            * g++.dg/template/builtin-speculation-overloads4.C: Likewise.
            * lib/target-supports.exp
            (check_effective_target_speculation_barrier_defined): New.

    Signed-off-by: Matthew Malcomson <mmalcom...@nvidia.com>

Reply via email to