This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] testsuite: Add new effective target keywords
- From: Björn Haase <bjoern dot m dot haase at web dot de>
- To: Janis Johnson <janis187 at us dot ibm dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>,gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Apr 2005 20:09:17 +0200
- Subject: Re: [PATCH] testsuite: Add new effective target keywords
- References: <200504072320.46784.bjoern.m.haase@web.de> <200504182153.40460.bjoern.m.haase@web.de> <20050418214402.GA6765@us.ibm.com>
Am Montag, 18. April 2005 23:44 schrieb Janis Johnson:
>
> It's getting close!
>
> Please use get_compiler_messages, used in several other places in
> target-supports.exp, to compile the testcase. Use the same formatting
> (initial spacing and tabs, in particular) as the rest of the file.
Hi,
I hope that this time :-) it's ok.
Yours,
Björn
2005-04-15 ?Bjoern Haase ?<bjoern.m.haase@web.de>
* lib/target-supports.exp (check_effective_target_trampolines): New.
(check_effective_target_int_larger_than_16_bits): New.
(check_profiling_available): Add avr-*-*.
Index: target-supports.exp
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/testsuite/lib/target-supports.exp,v
retrieving revision 1.50
diff -C8 -r1.50 target-supports.exp
*** target-supports.exp 14 Apr 2005 17:46:08 -0000 1.50
--- target-supports.exp 18 Apr 2005 20:42:42 -0000
***************
*** 247,262 ****
--- 247,314 ----
set gc_sections_available_saved 1
} else {
set gc_sections_available_saved 0
}
}
return $gc_sections_available_saved
}
+ # Looks at target_info struct and explicit target list
+ # for finding out whether target is supposed to support
+ # trampolines. In case of missing support return 0.
+
+ proc check_effective_target_trampolines { } {
+ if {[target_info exists no_trampolines]} {
+ return 0
+ }
+ if { [istarget avr-*-*]
+ || [istarget hppa2.0w-hp-hpux11.23]
+ || [istarget hppa64-hp-hpux11.23] } {
+ return 0;
+ }
+
+ return 1
+ }
+
+ # Find out whether target defines int to be
+ # larger than 16 bits and return 1 in this case.
+
+ proc check_effective_target_int_larger_than_16_bits { } {
+ global int_larger_than_16_bits_saved
+ global tool
+
+ if [info exists int_larger_than_16_bits_saved] {
+ verbose "check_effective_target_int_larger_than_16_bits returning saved $int_larger_than_16_bits_saved" 2
+ } else {
+ set src intsize[pid].c
+ set obj intsize[pid].o
+ verbose "check_effective_target_int_larger_than_16_bits compiling testfile $src" 2
+ set f [open $src "w"]
+ # Compile a small test program.
+ puts $f "#if (__INT_MAX__ <= 32767) \n this code triggers an error; \n#endif\n"
+ puts $f "int dummy;\n \n"
+ close $f
+ set lines [${tool}_target_compile $src $obj object ""]
+ file delete $src
+ remote_file build delete $obj
+
+ if [string match "" $lines] then {
+ # No error messages, so __INT_MAX__ > 32767.
+ set int_larger_than_16_bits_saved 1
+ } else {
+ set int_larger_than_16_bits_saved 0
+ }
+
+ verbose "check_effective_target_int_larger_than_16_bits returning $int_larger_than_16_bits_saved" 2
+ }
+
+ return $int_larger_than_16_bits_saved
+ }
+
# Return true if profiling is supported on the target.
proc check_profiling_available { test_what } {
global profiling_available_saved
verbose "Profiling argument is <$test_what>" 1
# These conditions depend on the argument so examine them before
***************
*** 282,297 ****
--- 334,350 ----
# Now examine the cache variable.
if {![info exists profiling_available_saved]} {
# Some targets don't have any implementation of __bb_init_func or are
# missing other needed machinery.
if { [istarget mmix-*-*]
|| [istarget arm*-*-eabi*]
|| [istarget arm*-*-elf]
|| [istarget arm*-*-symbianelf*]
+ || [istarget avr-*-*]
|| [istarget powerpc-*-eabi*]
|| [istarget strongarm*-*-elf]
|| [istarget xscale*-*-elf]
|| [istarget cris-*-*]
|| [istarget h8300-*-*]
|| [istarget mips*-*-elf]
|| [istarget *-*-windiss] } {
set profiling_available_saved 0