https://gcc.gnu.org/g:bee22599ac1ac4cc217dbfc432eedb0a4be351ef
commit bee22599ac1ac4cc217dbfc432eedb0a4be351ef Author: Michael Meissner <meiss...@linux.ibm.com> Date: Tue Jun 24 22:12:44 2025 -0400 Add -mcpu=future tests. This is patch #3 of 3 to add -mcpu=future support to the PowerPC. Compared to the previous version of tis patch, I update a comment to say _ARCH_FUTURE instead of _ARCH_PWR11 that was a typo. This patch adds simple tests for -mcpu=future. I have tested these patches on both big endian and little endian PowerPC servers, with no regressions. Can I check these patchs into the trunk? 2025-06-24 Michael Meissner <meiss...@linux.ibm.com> gcc/testsuite/ * gcc.target/powerpc/future-1.c: New test. * gcc.target/powerpc/future-2.c: Likewise. Diff: --- gcc/testsuite/gcc.target/powerpc/future-1.c | 13 +++++++++++++ gcc/testsuite/gcc.target/powerpc/future-2.c | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/gcc/testsuite/gcc.target/powerpc/future-1.c b/gcc/testsuite/gcc.target/powerpc/future-1.c index e69de29bb2d1..7bd8e5ddbd00 100644 --- a/gcc/testsuite/gcc.target/powerpc/future-1.c +++ b/gcc/testsuite/gcc.target/powerpc/future-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-mdejagnu-cpu=future -O2" } */ + +/* Basic check to see if the compiler supports -mcpu=future and if it defines + _ARCH_FUTURE. */ + +#ifndef _ARCH_FUTURE +#error "-mcpu=future is not supported" +#endif + +void foo (void) +{ +} diff --git a/gcc/testsuite/gcc.target/powerpc/future-2.c b/gcc/testsuite/gcc.target/powerpc/future-2.c index e69de29bb2d1..5552cefa3c2e 100644 --- a/gcc/testsuite/gcc.target/powerpc/future-2.c +++ b/gcc/testsuite/gcc.target/powerpc/future-2.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +/* Check if we can set the future target via a target attribute. */ + +__attribute__((__target__("cpu=power9"))) +void foo_p9 (void) +{ +} + +__attribute__((__target__("cpu=power10"))) +void foo_p10 (void) +{ +} + +__attribute__((__target__("cpu=power11"))) +void foo_p11 (void) +{ +} + +__attribute__((__target__("cpu=future"))) +void foo_future (void) +{ +}