diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/mips')
-rw-r--r-- | gcc/testsuite/gcc.target/mips/cache-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/mips/mips.exp | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/mips/mips16-attributes-4.c | 17 |
3 files changed, 30 insertions, 5 deletions
diff --git a/gcc/testsuite/gcc.target/mips/cache-1.c b/gcc/testsuite/gcc.target/mips/cache-1.c index 05cb4079157..da897066d49 100644 --- a/gcc/testsuite/gcc.target/mips/cache-1.c +++ b/gcc/testsuite/gcc.target/mips/cache-1.c @@ -26,5 +26,5 @@ f4 (const volatile unsigned char *area) /* { dg-final { scan-assembler "\tcache\t0x14,0\\(\\\$4\\)" } } */ /* { dg-final { scan-assembler "\tcache\t0x18,20\\(\\\$4\\)" } } */ -/* { dg-final { scan-assembler "\tcache\t0x0,0\\(\\\$.\\)" } } */ +/* { dg-final { scan-assembler "\tcache\t(0x|)0,0\\(\\\$.\\)" } } */ /* { dg-final { scan-assembler "\tcache\t0x4,-80\\(\\\$4\\)" } } */ diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp index 02e031cd15c..0a7bc1de8dd 100644 --- a/gcc/testsuite/gcc.target/mips/mips.exp +++ b/gcc/testsuite/gcc.target/mips/mips.exp @@ -233,7 +233,7 @@ set mips_option_groups { fp "-mfp(32|64)" gp "-mgp(32|64)" long "-mlong(32|64)" - mips16 "-mips16|-mno-mips16" + mips16 "-mips16|-mno-mips16|-mflip-mips16" mips3d "-mips3d|-mno-mips3d" optimization "-O(|[0-3s])" pic "-f(no-|)(pic|PIC)" @@ -509,6 +509,14 @@ proc mips_have_option_p { upstatus option } { $option] } +# Return true if the options described by UPSTATUS require MIPS16 support. +proc mips_using_mips16_p { upstatus } { + upvar $upstatus status + + return [expr { [mips_have_option_p status "-mips16"] + || [mips_have_option_p status "-mflip-mips16"] }] +} + # Return true if the test described by UPSTATUS requires option OPTION. proc mips_have_test_option_p { upstatus option } { upvar $upstatus status @@ -763,7 +771,7 @@ proc mips-dg-finish {} { # # START END # | | -# -mips16 -mno-mips16 +# -mips16/-mflip-mips16 -mno-mips16 # | | # -mips3d -mno-mips3d # | | @@ -1011,7 +1019,7 @@ proc mips-dg-options { args } { # EABI doesn't support -mabicalls. # EABI doesn't support the combination -mgp32 -mfp64. set force_abi 1 - } elseif { [mips_have_option_p options "-mips16"] + } elseif { [mips_using_mips16_p options] && ![mips_same_option_p $abi "-mabi=32"] && ![mips_same_option_p $abi "-mabi=o64"] && (![mips_have_option_p options "addressing=absolute"] @@ -1048,7 +1056,7 @@ proc mips-dg-options { args } { mips_make_test_option options "-mfp32" } } - if { [mips_have_option_p options "-mips16"] + if { [mips_using_mips16_p options] && ![mips_same_option_p $abi "-mabi=32"] && ![mips_same_option_p $abi "-mabi=o64"] && (![mips_have_option_p options "addressing=absolute"] diff --git a/gcc/testsuite/gcc.target/mips/mips16-attributes-4.c b/gcc/testsuite/gcc.target/mips/mips16-attributes-4.c new file mode 100644 index 00000000000..de7cb4349b7 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/mips16-attributes-4.c @@ -0,0 +1,17 @@ +/* { dg-do run } */ +/* { dg-options "(-mips16)" } */ + +extern void abort (void); + +__complex float f = { -1.0 + -1.0i }; +__complex float __attribute__((nomips16)) foo (void) { return f; } +__complex float (*volatile foop) (void) = foo; +__complex float __attribute__((mips16, noinline)) bar (void) { return foop (); } + +int +main (void) +{ + if (bar () != f) + abort (); + return 0; +} |