From patchwork Thu Nov 15 18:44:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 199372 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 904202C0348 for ; Fri, 16 Nov 2012 05:44:12 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1353609852; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=6/txhqqLHk6Sr6p/LgP/GWk0Jjo=; b=NRR6Skf5/OVhZvpGexh0YgXZI0VztrkctOD1RDYmAZZ1zXYLt5Z4ZuthwlNfyF MKn7pOJzkpsimYmTSrwdgd2GstsP2oTjQ3gcjvA5xlU3MKY9w4pd8n5UT2ms2kgc fgWURqB3naTuMnLU2h0uVO2LwjVGjpyU+kHd74RAzW5/c= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=V+SWTuMviVcE3lVqWYmcSVNkHXjFteOVO4JskHbtJOerKcZN+hMp4Fu88GyNk+ oO5GR9PzUqmChQ/iR2LVk8cHjl98oSfyRNFEpKGdhjV9Hi+0zDNo5qYGEX4Pyzw6 DblFbtj88oa0xQRIViZ9fCzJtaBOk2iv3ijB812yI06HE=; Received: (qmail 4203 invoked by alias); 15 Nov 2012 18:44:06 -0000 Received: (qmail 4194 invoked by uid 22791); 15 Nov 2012 18:44:05 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_QF X-Spam-Check-By: sourceware.org Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Nov 2012 18:44:01 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa11so1215060pad.20 for ; Thu, 15 Nov 2012 10:44:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.66.81.138 with SMTP id a10mr5605847pay.53.1353005040783; Thu, 15 Nov 2012 10:44:00 -0800 (PST) Received: by 10.66.246.232 with HTTP; Thu, 15 Nov 2012 10:44:00 -0800 (PST) In-Reply-To: <20121115164457.GZ1886@tucnak.redhat.com> References: <20121115162519.GX1886@tucnak.redhat.com> <20121115163458.GY1886@tucnak.redhat.com> <20121115164457.GZ1886@tucnak.redhat.com> Date: Thu, 15 Nov 2012 19:44:00 +0100 Message-ID: Subject: Re: [PATCH v2, testsuite]: Add dg-error for unsupported floating suffix From: Uros Bizjak To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Thu, Nov 15, 2012 at 5:44 PM, Jakub Jelinek wrote: >> >> 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. >> > >> > But -std=c++11 (well, perhaps -std=gnu++11) could be eventually the default. >> > As Q/W suffixes are only supported in certain modes through >> > TARGET_C_MODE_FOR_SUFFIX, it is better to put the explicit option that >> > allows it on the command line of the check_effective_target* test. >> >> Do you have option in mind that would be appropriate for the test? > > "-std=gnu++03" ? Adding "-w" to skip a warning that this option applies only to c++ did the trick. Thanks, Uros. 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; + } "-std=gnu++03 -w"] +} + +# 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; + } "-std=gnu++03 -w"] +} # Return 1 if the target supports compiling fixed-point, # 0 otherwise. Index: g++.dg/cpp0x/gnu_fext-numeric-literals.C =================================================================== --- g++.dg/cpp0x/gnu_fext-numeric-literals.C (revision 193533) +++ g++.dg/cpp0x/gnu_fext-numeric-literals.C (working copy) @@ -91,10 +91,10 @@ auto rfp = 1.0r; // { dg-error "fixed-point types not supported" } auto Rfp = 1.0R; // { dg-error "fixed-point types not supported" } - auto wfp = 1.0w; - auto Wfp = 1.0W; - auto qfp = 1.0q; - auto Qfp = 1.0Q; + auto wfp = 1.0w; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto Wfp = 1.0W; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto qfp = 1.0q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } + auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } } // { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 } Index: g++.dg/cpp0x/std_fext-numeric-literals.C =================================================================== --- g++.dg/cpp0x/std_fext-numeric-literals.C (revision 193533) +++ g++.dg/cpp0x/std_fext-numeric-literals.C (working copy) @@ -91,10 +91,10 @@ auto rfp = 1.0r; // { dg-error "fixed-point types not supported" } auto Rfp = 1.0R; // { dg-error "fixed-point types not supported" } - auto wfp = 1.0w; - auto Wfp = 1.0W; - auto qfp = 1.0q; - auto Qfp = 1.0Q; + auto wfp = 1.0w; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto Wfp = 1.0W; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto qfp = 1.0q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } + auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } } // { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 }