From ef834ed9da2903adc3ecf4b33ada4e85c08dd394 Mon Sep 17 00:00:00 2001 From: Kelvin Nilsen Date: Mon, 11 May 2020 08:44:48 -0500 Subject: [PATCH] rs6000: powerpc_future_ok and powerpc_future_hw Dejagnu targets for these. 2020-05-11 Kelvin Nilsen * gcc.target/powerpc/dg-future-0.c: New. * gcc.target/powerpc/dg-future-1.c: New. * lib/target-supports.exp (check_powerpc_future_hw_available): Replace -mfuture with -mcpu=future. (check_effective_target_powerpc_future_ok): Likewise. (is-effective-target): Add powerpc_future_hw. --- .../gcc.target/powerpc/dg-future-0.c | 14 ++++++++++++++ .../gcc.target/powerpc/dg-future-1.c | 19 +++++++++++++++++++ gcc/testsuite/lib/target-supports.exp | 5 +++-- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/dg-future-0.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dg-future-1.c diff --git a/gcc/testsuite/gcc.target/powerpc/dg-future-0.c b/gcc/testsuite/gcc.target/powerpc/dg-future-0.c new file mode 100644 index 00000000000..abfda82a684 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dg-future-0.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-options "-mdejagnu-cpu=future" } */ + +/* This tests that powerpc_future_ok works. */ + +extern void abort (void); + +int futurity (void) { + long int e = -1; + asm ("pli %0,%1": "+r" (e) : "n" (0x12345)); + return (e == 0x12345); +} + +/* { dg-final { scan-assembler {\mpli\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/dg-future-1.c b/gcc/testsuite/gcc.target/powerpc/dg-future-1.c new file mode 100644 index 00000000000..6087fe7c894 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dg-future-1.c @@ -0,0 +1,19 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_hw } */ +/* { dg-options "-mdejagnu-cpu=future" } */ + +/* This tests that powerpc_future_hw works. */ + +extern void abort (void); + +int futurity (void) { + long int e = -1; + asm ("pli %0,%1": "+r" (e) : "n" (0x12345)); + return (e == 0x12345); +} + +int main (int argc, char *argv []) +{ + if (!futurity ()) + abort (); +} diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index a96b0525ba9..3a6ab8740c3 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2203,7 +2203,7 @@ proc check_powerpc_future_hw_available { } { asm ("pli %0,%1" : "+r" (e) : "n" (0x12345)); return (e == 0x12345); } - } "-mfuture" + } "-mcpu=future" }] } @@ -5815,7 +5815,7 @@ proc check_effective_target_powerpc_future_ok { } { asm ("pli %0,%1" : "=r" (e) : "n" (0x12345)); return e; } - } "-mfuture"] + } "-mcpu=future"] } else { return 0 } @@ -7762,6 +7762,7 @@ proc is-effective-target { arg } { "named_sections" { set selected [check_named_sections_available] } "gc_sections" { set selected [check_gc_sections_available] } "cxa_atexit" { set selected [check_cxa_atexit_available] } + "powerpc_future_hw" { set selected [check_powerpc_future_hw_available] } default { error "unknown effective target keyword `$arg'" } } } -- 2.30.2