testsuite: error out with tested condition instead of FOO

Use the (abbreviated) proprocessor condition for #error instead of FOO
so one can see the test issued.

2012-12-01  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

    * lib/target-supports.exp: error out with preprocessor condition
    instead of FOO everywhere.

From-SVN: r215759
parent 4db7fcb9
2014-10-01 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
* lib/target-supports.exp: error out with preprocessor condition
instead of FOO everywhere.
2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net> 2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement SD-6: SG10 Feature Test Recommendations Implement SD-6: SG10 Feature Test Recommendations
......
...@@ -865,7 +865,7 @@ proc check_effective_target_hard_float { } { ...@@ -865,7 +865,7 @@ proc check_effective_target_hard_float { } {
if { [istarget mips*-*-*] } { if { [istarget mips*-*-*] } {
return [check_no_compiler_messages hard_float assembly { return [check_no_compiler_messages hard_float assembly {
#if (defined __mips_soft_float || defined __mips16) #if (defined __mips_soft_float || defined __mips16)
#error FOO #error __mips_soft_float || __mips16
#endif #endif
}] }]
} }
...@@ -877,7 +877,7 @@ proc check_effective_target_hard_float { } { ...@@ -877,7 +877,7 @@ proc check_effective_target_hard_float { } {
return 0 return 0
# return [check_no_compiler_messages hard_float assembly { # return [check_no_compiler_messages hard_float assembly {
#if defined __RX_64_BIT_DOUBLES__ #if defined __RX_64_BIT_DOUBLES__
#error FOO #error __RX_64_BIT_DOUBLES__
#endif #endif
# }] # }]
} }
...@@ -893,7 +893,7 @@ proc check_effective_target_hard_float { } { ...@@ -893,7 +893,7 @@ proc check_effective_target_hard_float { } {
proc check_effective_target_mips64 { } { proc check_effective_target_mips64 { } {
return [check_no_compiler_messages mips64 assembly { return [check_no_compiler_messages mips64 assembly {
#ifndef __mips64 #ifndef __mips64
#error FOO #error !__mips64
#endif #endif
}] }]
} }
...@@ -904,7 +904,7 @@ proc check_effective_target_mips64 { } { ...@@ -904,7 +904,7 @@ proc check_effective_target_mips64 { } {
proc check_effective_target_nomips16 { } { proc check_effective_target_nomips16 { } {
return [check_no_compiler_messages nomips16 object { return [check_no_compiler_messages nomips16 object {
#ifndef __mips #ifndef __mips
#error FOO #error !__mips
#else #else
/* A cheap way of testing for -mflip-mips16. */ /* A cheap way of testing for -mflip-mips16. */
void foo (void) { asm ("addiu $20,$20,1"); } void foo (void) { asm ("addiu $20,$20,1"); }
...@@ -927,12 +927,12 @@ proc add_options_for_mips16_attribute { flags } { ...@@ -927,12 +927,12 @@ proc add_options_for_mips16_attribute { flags } {
proc check_effective_target_mips16_attribute { } { proc check_effective_target_mips16_attribute { } {
return [check_no_compiler_messages mips16_attribute assembly { return [check_no_compiler_messages mips16_attribute assembly {
#ifdef PIC #ifdef PIC
#error FOO #error PIC
#endif #endif
#if defined __mips_hard_float \ #if defined __mips_hard_float \
&& (!defined _ABIO32 || _MIPS_SIM != _ABIO32) \ && (!defined _ABIO32 || _MIPS_SIM != _ABIO32) \
&& (!defined _ABIO64 || _MIPS_SIM != _ABIO64) && (!defined _ABIO64 || _MIPS_SIM != _ABIO64)
#error FOO #error __mips_hard_float && (!_ABIO32 || !_ABIO64)
#endif #endif
} [add_options_for_mips16_attribute ""]] } [add_options_for_mips16_attribute ""]]
} }
...@@ -961,7 +961,7 @@ proc check_effective_target_mips_llsc { } { ...@@ -961,7 +961,7 @@ proc check_effective_target_mips_llsc { } {
# Otherwise assume LL/SC support for everything but MIPS I. # Otherwise assume LL/SC support for everything but MIPS I.
return [check_no_compiler_messages mips_llsc assembly { return [check_no_compiler_messages mips_llsc assembly {
#if __mips == 1 #if __mips == 1
#error FOO #error __mips == 1
#endif #endif
}] }]
} }
...@@ -975,7 +975,7 @@ proc check_effective_target_mips_rel { } { ...@@ -975,7 +975,7 @@ proc check_effective_target_mips_rel { } {
return [check_no_compiler_messages mips_rel object { return [check_no_compiler_messages mips_rel object {
#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) \ #if (defined _ABIN32 && _MIPS_SIM == _ABIN32) \
|| (defined _ABI64 && _MIPS_SIM == _ABI64) || (defined _ABI64 && _MIPS_SIM == _ABI64)
#error FOO #error _ABIN32 && (_ABIN32 || _ABI64)
#endif #endif
}] }]
} }
...@@ -988,7 +988,7 @@ proc check_effective_target_mips_eabi { } { ...@@ -988,7 +988,7 @@ proc check_effective_target_mips_eabi { } {
} }
return [check_no_compiler_messages mips_eabi object { return [check_no_compiler_messages mips_eabi object {
#ifndef __mips_eabi #ifndef __mips_eabi
#error FOO #error !__mips_eabi
#endif #endif
}] }]
} }
...@@ -998,7 +998,7 @@ proc check_effective_target_mips_eabi { } { ...@@ -998,7 +998,7 @@ proc check_effective_target_mips_eabi { } {
proc check_effective_target_nonpic { } { proc check_effective_target_nonpic { } {
return [check_no_compiler_messages nonpic assembly { return [check_no_compiler_messages nonpic assembly {
#if __PIC__ #if __PIC__
#error FOO #error __PIC__
#endif #endif
}] }]
} }
...@@ -1617,7 +1617,7 @@ proc check_effective_target_broken_cplxf_arg { } { ...@@ -1617,7 +1617,7 @@ proc check_effective_target_broken_cplxf_arg { } {
proc check_effective_target_ti_c67x { } { proc check_effective_target_ti_c67x { } {
return [check_no_compiler_messages ti_c67x assembly { return [check_no_compiler_messages ti_c67x assembly {
#if !defined(_TMS320C6700) #if !defined(_TMS320C6700)
#error FOO #error !_TMS320C6700
#endif #endif
}] }]
} }
...@@ -1626,7 +1626,7 @@ proc check_effective_target_ti_c67x { } { ...@@ -1626,7 +1626,7 @@ proc check_effective_target_ti_c67x { } {
proc check_effective_target_ti_c64xp { } { proc check_effective_target_ti_c64xp { } {
return [check_no_compiler_messages ti_c64xp assembly { return [check_no_compiler_messages ti_c64xp assembly {
#if !defined(_TMS320C6400_PLUS) #if !defined(_TMS320C6400_PLUS)
#error FOO #error !_TMS320C6400_PLUS
#endif #endif
}] }]
} }
...@@ -1721,8 +1721,8 @@ proc check_effective_target_objc2 { } { ...@@ -1721,8 +1721,8 @@ proc check_effective_target_objc2 { } {
#ifdef __OBJC2__ #ifdef __OBJC2__
int dummy[1]; int dummy[1];
#else #else
#error #error !__OBJC2__
#endif #endif
}] }]
} }
...@@ -1731,8 +1731,8 @@ proc check_effective_target_next_runtime { } { ...@@ -1731,8 +1731,8 @@ proc check_effective_target_next_runtime { } {
#ifdef __NEXT_RUNTIME__ #ifdef __NEXT_RUNTIME__
int dummy[1]; int dummy[1];
#else #else
#error #error !__NEXT_RUNTIME__
#endif #endif
}] }]
} }
...@@ -2244,7 +2244,7 @@ proc check_effective_target_vect_simd_clones { } { ...@@ -2244,7 +2244,7 @@ proc check_effective_target_vect_simd_clones { } {
proc check_effective_target_aarch64_big_endian { } { proc check_effective_target_aarch64_big_endian { } {
return [check_no_compiler_messages aarch64_big_endian assembly { return [check_no_compiler_messages aarch64_big_endian assembly {
#if !defined(__aarch64__) || !defined(__AARCH64EB__) #if !defined(__aarch64__) || !defined(__AARCH64EB__)
#error FOO #error !__aarch64__ || !__AARCH64EB__
#endif #endif
}] }]
} }
...@@ -2262,7 +2262,7 @@ proc check_effective_target_aarch64_little_endian { } { ...@@ -2262,7 +2262,7 @@ proc check_effective_target_aarch64_little_endian { } {
proc check_effective_target_arm32 { } { proc check_effective_target_arm32 { } {
return [check_no_compiler_messages arm32 assembly { return [check_no_compiler_messages arm32 assembly {
#if !defined(__arm__) || (defined(__thumb__) && !defined(__thumb2__)) #if !defined(__arm__) || (defined(__thumb__) && !defined(__thumb2__))
#error FOO #error !__arm || __thumb__ && !__thumb2__
#endif #endif
}] }]
} }
...@@ -2271,7 +2271,7 @@ proc check_effective_target_arm32 { } { ...@@ -2271,7 +2271,7 @@ proc check_effective_target_arm32 { } {
proc check_effective_target_arm_nothumb { } { proc check_effective_target_arm_nothumb { } {
return [check_no_compiler_messages arm_nothumb assembly { return [check_no_compiler_messages arm_nothumb assembly {
#if !defined(__arm__) || (defined(__thumb__) || defined(__thumb2__)) #if !defined(__arm__) || (defined(__thumb__) || defined(__thumb2__))
#error FOO #error !__arm__ || __thumb || __thumb2__
#endif #endif
}] }]
} }
...@@ -2280,7 +2280,7 @@ proc check_effective_target_arm_nothumb { } { ...@@ -2280,7 +2280,7 @@ proc check_effective_target_arm_nothumb { } {
proc check_effective_target_arm_little_endian { } { proc check_effective_target_arm_little_endian { } {
return [check_no_compiler_messages arm_little_endian assembly { return [check_no_compiler_messages arm_little_endian assembly {
#if !defined(__arm__) || !defined(__ARMEL__) #if !defined(__arm__) || !defined(__ARMEL__)
#error FOO #error !__arm__ || !__ARMEL__
#endif #endif
}] }]
} }
...@@ -2291,7 +2291,7 @@ proc check_effective_target_arm_vect_no_misalign { } { ...@@ -2291,7 +2291,7 @@ proc check_effective_target_arm_vect_no_misalign { } {
#if !defined(__arm__) \ #if !defined(__arm__) \
|| (defined(__ARM_FEATURE_UNALIGNED) \ || (defined(__ARM_FEATURE_UNALIGNED) \
&& defined(__ARMEL__)) && defined(__ARMEL__))
#error FOO #error !__arm__ || (__ARMEL__ && __ARM_FEATURE_UNALIGNED)
#endif #endif
}] }]
} }
...@@ -2719,7 +2719,7 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__ ...@@ -2719,7 +2719,7 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__
} }
return [check_no_compiler_messages arm_arch_FUNC_ok assembly { return [check_no_compiler_messages arm_arch_FUNC_ok assembly {
#if !defined (DEF) #if !defined (DEF)
#error FOO #error !DEF
#endif #endif
} "FLAG" ] } "FLAG" ]
} }
...@@ -2746,7 +2746,7 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__ ...@@ -2746,7 +2746,7 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__
proc check_effective_target_arm_arm_ok { } { proc check_effective_target_arm_arm_ok { } {
return [check_no_compiler_messages arm_arm_ok assembly { return [check_no_compiler_messages arm_arm_ok assembly {
#if !defined (__arm__) || defined (__thumb__) || defined (__thumb2__) #if !defined (__arm__) || defined (__thumb__) || defined (__thumb2__)
#error FOO #error !__arm__ || __thumb__ || __thumb2__
#endif #endif
} "-marm"] } "-marm"]
} }
...@@ -2758,7 +2758,7 @@ proc check_effective_target_arm_arm_ok { } { ...@@ -2758,7 +2758,7 @@ proc check_effective_target_arm_arm_ok { } {
proc check_effective_target_arm_thumb1_ok { } { proc check_effective_target_arm_thumb1_ok { } {
return [check_no_compiler_messages arm_thumb1_ok assembly { return [check_no_compiler_messages arm_thumb1_ok assembly {
#if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__) #if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__)
#error FOO #error !__arm__ || !__thumb__ || __thumb2__
#endif #endif
int foo (int i) { return i; } int foo (int i) { return i; }
} "-mthumb"] } "-mthumb"]
...@@ -2770,7 +2770,7 @@ proc check_effective_target_arm_thumb1_ok { } { ...@@ -2770,7 +2770,7 @@ proc check_effective_target_arm_thumb1_ok { } {
proc check_effective_target_arm_thumb2_ok { } { proc check_effective_target_arm_thumb2_ok { } {
return [check_no_compiler_messages arm_thumb2_ok assembly { return [check_no_compiler_messages arm_thumb2_ok assembly {
#if !defined(__thumb2__) #if !defined(__thumb2__)
#error FOO #error !__thumb2__
#endif #endif
int foo (int i) { return i; } int foo (int i) { return i; }
} "-mthumb"] } "-mthumb"]
...@@ -2782,7 +2782,7 @@ proc check_effective_target_arm_thumb2_ok { } { ...@@ -2782,7 +2782,7 @@ proc check_effective_target_arm_thumb2_ok { } {
proc check_effective_target_arm_thumb1 { } { proc check_effective_target_arm_thumb1 { } {
return [check_no_compiler_messages arm_thumb1 assembly { return [check_no_compiler_messages arm_thumb1 assembly {
#if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__) #if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__)
#error not thumb1 #error !__arm__ || !__thumb__ || __thumb2__
#endif #endif
int i; int i;
} ""] } ""]
...@@ -2794,7 +2794,7 @@ proc check_effective_target_arm_thumb1 { } { ...@@ -2794,7 +2794,7 @@ proc check_effective_target_arm_thumb1 { } {
proc check_effective_target_arm_thumb2 { } { proc check_effective_target_arm_thumb2 { } {
return [check_no_compiler_messages arm_thumb2 assembly { return [check_no_compiler_messages arm_thumb2 assembly {
#if !defined(__thumb2__) #if !defined(__thumb2__)
#error FOO #error !__thumb2__
#endif #endif
int i; int i;
} ""] } ""]
...@@ -2821,7 +2821,7 @@ proc check_effective_target_arm_cortex_m { } { ...@@ -2821,7 +2821,7 @@ proc check_effective_target_arm_cortex_m { } {
#if !defined(__ARM_ARCH_7M__) \ #if !defined(__ARM_ARCH_7M__) \
&& !defined (__ARM_ARCH_7EM__) \ && !defined (__ARM_ARCH_7EM__) \
&& !defined (__ARM_ARCH_6M__) && !defined (__ARM_ARCH_6M__)
#error FOO #error !__ARM_ARCH_7M__ && !__ARM_ARCH_7EM__ && !__ARM_ARCH_6M__
#endif #endif
int i; int i;
} "-mthumb"] } "-mthumb"]
...@@ -2917,7 +2917,7 @@ proc check_effective_target_arm_neonv2 { } { ...@@ -2917,7 +2917,7 @@ proc check_effective_target_arm_neonv2 { } {
proc check_effective_target_mips_loongson { } { proc check_effective_target_mips_loongson { } {
return [check_no_compiler_messages loongson assembly { return [check_no_compiler_messages loongson assembly {
#if !defined(__mips_loongson_vector_rev) #if !defined(__mips_loongson_vector_rev)
#error FOO #error !__mips_loongson_vector_rev
#endif #endif
}] }]
} }
...@@ -5022,7 +5022,7 @@ proc check_effective_target_sync_char_short { } { ...@@ -5022,7 +5022,7 @@ proc check_effective_target_sync_char_short { } {
proc check_effective_target_coldfire_fpu { } { proc check_effective_target_coldfire_fpu { } {
return [check_no_compiler_messages coldfire_fpu assembly { return [check_no_compiler_messages coldfire_fpu assembly {
#ifndef __mcffpu__ #ifndef __mcffpu__
#error FOO #error !__mcffpu__
#endif #endif
}] }]
} }
...@@ -5033,7 +5033,7 @@ proc check_effective_target_uclibc {} { ...@@ -5033,7 +5033,7 @@ proc check_effective_target_uclibc {} {
return [check_no_compiler_messages uclibc object { return [check_no_compiler_messages uclibc object {
#include <features.h> #include <features.h>
#if !defined (__UCLIBC__) #if !defined (__UCLIBC__)
#error FOO #error !__UCLIBC__
#endif #endif
}] }]
} }
...@@ -5361,7 +5361,7 @@ proc add_options_for_bind_pic_locally { flags } { ...@@ -5361,7 +5361,7 @@ proc add_options_for_bind_pic_locally { flags } {
if {[check_no_compiler_messages using_pic2 assembly { if {[check_no_compiler_messages using_pic2 assembly {
#if __PIC__ != 2 #if __PIC__ != 2
#error FOO #error __PIC__ != 2
#endif #endif
}]} { }]} {
set flags_to_postpone "-fPIE" set flags_to_postpone "-fPIE"
...@@ -5369,7 +5369,7 @@ proc add_options_for_bind_pic_locally { flags } { ...@@ -5369,7 +5369,7 @@ proc add_options_for_bind_pic_locally { flags } {
} }
if {[check_no_compiler_messages using_pic1 assembly { if {[check_no_compiler_messages using_pic1 assembly {
#if __PIC__ != 1 #if __PIC__ != 1
#error FOO #error __PIC__ != 1
#endif #endif
}]} { }]} {
set flags_to_postpone "-fpie" set flags_to_postpone "-fpie"
...@@ -5399,7 +5399,7 @@ proc check_effective_target_c99_runtime { } { ...@@ -5399,7 +5399,7 @@ proc check_effective_target_c99_runtime { } {
close $file close $file
append contents { append contents {
#ifndef HAVE_C99_RUNTIME #ifndef HAVE_C99_RUNTIME
#error FOO #error !HAVE_C99_RUNTIME
#endif #endif
} }
check_no_compiler_messages_nocache c99_runtime assembly \ check_no_compiler_messages_nocache c99_runtime assembly \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment