This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2, testsuite]: Add dg-error for unsupported floating suffix


On Fri, Nov 16, 2012 at 08:53:54AM +0100, Uros Bizjak wrote:
> 2012-11-16  Uros Bizjak  <ubizjak@gmail.com>
> 
> 	* lib/target_suports.exp
> 	(check_effective_target_has_w_floating_suffix): New procedure.
> 	(check_effective_target_has_q_floating_suffix): Ditto.
> 	* g++.dg/cpp0x/gnu_fext-numeric-literals.C: Add dg-error directive
> 	for unsupported non-standard suffix on floating constant.
> 	* g++.dg/cpp0x/std_fext-numeric-literals.C: Ditto.
> 
> Attached patch was re-tested on alphaev68-linux-gnu and
> x86_64-linux-gnu and committed to mainline SVN.

Perhaps just bike-shed, but I'd write it as:

> +# Return 1 if the target supports 'w' suffix on floating constant
> +# 0 otherwise.
> +
> +proc check_effective_target_has_w_floating_suffix { } {
    if [check_effective_target_c++] {
	opts="-std=gnu++03"
    else
	opts=""
    }
> +    return [check_no_compiler_messages w_fp_suffix object {
> +	float dummy = 1.0w;
       } "$opts"]

but I admit I haven't tested it.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]