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 Thu, Nov 15, 2012 at 5:25 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Nov 15, 2012 at 05:20:48PM +0100, Uros Bizjak wrote:
>> This revision auto-detect support for Q and W suffixes.
>>
>> 2012-11-15  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.
>>
>> Tested on alphaev68-pc-linux-gnu and x86_64-pc-linux-gnu.
>>
>> OK for mainline?
>
>> Index: lib/target-supports.exp
>> ===================================================================
>> --- lib/target-supports.exp   (revision 193533)
>> +++ lib/target-supports.exp   (working copy)
>> @@ -1742,6 +1742,23 @@
>>      }]
>>  }
>>
>> +# Return 1 if the target supports 'w' suffix on floating constant
>> +# 0 otherwise.
>> +
>> +proc check_effective_target_has_w_floating_suffix { } {
>> +    return [check_no_compiler_messages w_fp_suffix object {
>> +     float dummy = 1.0w;
>> +    }]
>> +}
>> +
>> +# Return 1 if the target supports 'q' suffix on floating constant
>> +# 0 otherwise.
>> +
>> +proc check_effective_target_has_q_floating_suffix { } {
>> +    return [check_no_compiler_messages q_fp_suffix object {
>> +     float dummy = 1.0q;
>> +    }]
>
> Don't you need to make sure you are compiling this either with C, or C++
> with -std=gnu++03/11 or whatever other option is needed to enable those?
> With -std=c++11 without other options I believe this is now rejected,
> even when the target supports it.

No, the intention of this test is to check if target can handle these
suffixes through TARGET_C_MODE_FOR_SUFFIX. Please note that in
particular tests, -std=x compile switches are added to compile flags.

Uros.


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