This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [committed] Add mips16_attribute to gcc.target/mips/scc-[13].c
- From: Adam Nemet <anemet at caviumnetworks dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rdsandiford at googlemail dot com
- Date: Sat, 10 May 2008 14:43:17 -0700
- Subject: Re: [committed] Add mips16_attribute to gcc.target/mips/scc-[13].c
- References: <873aoqe4zp.fsf@firetop.home>
Richard Sandiford <rdsandiford@googlemail.com> writes:
> The tests in $subject are failing for PIC targets because we don't
> support MIPS16 PIC.
>
> /* { dg-do compile { target mips16_attribute } } */
>
> makes sure we can force a compilation mode that accepts "mips16"
> attributes (such as "-mno-abicalls") and
>
> /* { dg-add-options mips16_attribute } */
>
> does the forcing.
Sorry for missing this. How about something like the patch below so that one
would catch this without actually trying an abicall target? (I guess the idea
is that that you're not supposed to use MIPS16 unless you use dg-add-options
mips16_attribute as well.)
I still need to test this though but it seems to work on scc-1.c.
Adam
* gcc.target/mips/mips.exp: Move passing -DMIPS16=... from here ...
* lib/target-supports.exp (add_options_for_mips16_attribute): ... to
* here.
Index: gcc.target/mips/mips.exp
===================================================================
--- gcc.target/mips/mips.exp (revision 134606)
+++ gcc.target/mips/mips.exp (working copy)
@@ -373,6 +373,7 @@ proc dg-mips-options {args} {
setup_mips_tests
dg-init
+# MIPS16 is defined in add_options_for_mips16_attribute.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" \
- "-DMIPS16=__attribute__((mips16)) -DNOMIPS16=__attribute__((nomips16))"
+ "-DNOMIPS16=__attribute__((nomips16))"
dg-finish
Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp (revision 134606)
+++ lib/target-supports.exp (working copy)
@@ -643,7 +643,7 @@ proc check_effective_target_nomips16 { }
# we don't support MIPS16 PIC.
proc add_options_for_mips16_attribute { flags } {
- return "$flags -mno-abicalls -fno-pic"
+ return "$flags -mno-abicalls -fno-pic -DMIPS16=__attribute__((mips16))"
}
# Return true if we can force a mode that allows MIPS16 code generation.