diff options
author | Kelvin Nilsen <kelvin@gcc.gnu.org> | 2020-05-11 08:44:48 -0500 |
---|---|---|
committer | Bill Schmidt <wschmidt@linux.ibm.com> | 2020-05-11 08:44:48 -0500 |
commit | ef834ed9da2903adc3ecf4b33ada4e85c08dd394 (patch) | |
tree | 824e5e1b7f8b2ddb4af1e4990d0fb10ee2d78e76 /gcc | |
parent | ffeb6554bee0f5c3bf2f823aeb1af5c0b3f3cb00 (diff) | |
download | gcc-ef834ed9da2903adc3ecf4b33ada4e85c08dd394.zip gcc-ef834ed9da2903adc3ecf4b33ada4e85c08dd394.tar.gz gcc-ef834ed9da2903adc3ecf4b33ada4e85c08dd394.tar.bz2 |
rs6000: powerpc_future_ok and powerpc_future_hw
Dejagnu targets for these.
2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
* 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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/dg-future-0.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/dg-future-1.c | 19 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 5 |
3 files changed, 36 insertions, 2 deletions
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 0000000..abfda82 --- /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 0000000..6087fe7 --- /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 a96b052..3a6ab87 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'" } } } |