Message ID | ZVxuwE3jA7cIIf71@tucnak |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp482970vqb; Tue, 21 Nov 2023 00:48:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9XH6okLclBSehTz6FzBlNvuCW3L5WnsYSXS3MmeSv9IvYHGWPOawXzwy+Gn8qbZWPXWMj X-Received: by 2002:ad4:5ced:0:b0:671:3f49:c8b4 with SMTP id iv13-20020ad45ced000000b006713f49c8b4mr14586061qvb.3.1700556521064; Tue, 21 Nov 2023 00:48:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700556521; cv=pass; d=google.com; s=arc-20160816; b=dn2d2UpoJLnSOmnN64qY2Ish+hjpcCWrN6CjgvnU7uNjHL0nuXXmmGRl+lPa5evKsA LgSKY+vyR1Xp/Xh9vtns5/wD+8vo5rseCyoXlP3E4xEmDNWQRuu4SjlEgoIvULyB8gjM utelgIa+nGrxsXu7i64xD0mqJQS5b24wz/tZfshE/PYvNs9wLtoPlUTBOhnh7XuBtcDt lCUkBW79rsw/ehzk58EsQsZT7XtzfxSUQaVjvySogSR4a97bKkNajEwi4OoaGudkmugQ DUrdK84DCjdrG6tPKoAnbBGTBmObGNMUsqMQQriNGMY3W4eV5ihQRTkADoSB6ZwwM7El rQMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Cfev5wbtSGLVj5zM5xQNbmVnpc/xf/Qt/IadYjuyeYQ=; fh=FCjeRajqaQYHMkQtfIia8KT5yBac53mYOLLyJhYG/AY=; b=QYg1jbB7hwfBND2a6tntmZR2kklzS1XuX9QUMfv7Myha2aFTk3yG9BcaiLqFOvb1/3 P6dZhLcHZl0KpMy/kXvsj60yEnrEY9lBRIxXvGjgn1Au6+Q1pBmL0y1BsHk/Prd6bN7m E5BcSSRqqM/a0ECjxnJ0X6cyuOLpD8wJpCYzWjozZelKX7VFE11V/RadTbOZ318zB4c/ HErhv1ORs5MwJXNAvo/SlDbLSJyVdCqp6Awgp5TodG/encJTJDFeHU/HQQi/01hoCKsR jOaG3dJVKTPryls/riChCSoKR6wb7K1v+hZwCvLs833h6wjx3YIVUYq7MuPJZ6IFyd6r H4LA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a4WLgcJD; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id v3-20020a0ccd83000000b0064f68c194a6si8936580qvm.73.2023.11.21.00.48.40 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 00:48:41 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a4WLgcJD; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C67DA3858C2F for <ouuuleilei@gmail.com>; Tue, 21 Nov 2023 08:48:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7B5473858D39 for <gcc-patches@gcc.gnu.org>; Tue, 21 Nov 2023 08:48:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7B5473858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7B5473858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700556494; cv=none; b=ETHnvt5yyCyMhw8IYEKCvws5iwsv77RKwtyQ0ARNyuZtZ8GQ4FtPR5F3qrV88gpCk5dK6csWqs8NfThqe6hJo7g72CnrPzgx85JOKayrtMCOsPgd1+6lzZII88N4LnYDCc1gV1V7zORm1/AuRkTjK4PSn4cRW5NwmO55lfWu0H8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700556494; c=relaxed/simple; bh=8GSnk3Lu1DhQo7wzmkhelTFlsQ7NGA1tRETN1CXlUtQ=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=hHiNpq9V0pzOhYeMltJvZEtZWAQw7SDqbKsRPaAm2gkhHAtjI1W6jtZCntbkGia4kv4KeEasJyhCvKoOdSW4L0sok3ghzKtV/+r1Jyu50VF3FJm3uodAKNAk9rZu2kUOKbeMNnIbV4zQ3Cdocper5Jo+AZHhCCk6FNiIGdAgmpA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700556493; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=Cfev5wbtSGLVj5zM5xQNbmVnpc/xf/Qt/IadYjuyeYQ=; b=a4WLgcJDm4aIIYUBE6hVg7cox83moP2TVeS1B/lWKE/7refOioKk8gAnl45gXQEq5aUIcj SiDE/4FhMyRoWxcnhfaoAltbTCPj15ELlGS/LCLKnWA3/LWPEKC9uzesqXJK3jgcEzV3sj W6BzDDUgLB95N/5Q5aJY57kXVJJJ3yQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-NEZsMIq9PyylT6Wn7e2vww-1; Tue, 21 Nov 2023 03:48:09 -0500 X-MC-Unique: NEZsMIq9PyylT6Wn7e2vww-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 59DD5821BCB; Tue, 21 Nov 2023 08:48:09 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D3E1C1596F; Tue, 21 Nov 2023 08:48:09 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3AL8m1w74109479 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 09:48:01 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3AL8m04l4109478; Tue, 21 Nov 2023 09:48:00 +0100 Date: Tue, 21 Nov 2023 09:48:00 +0100 From: Jakub Jelinek <jakub@redhat.com> To: Richard Biener <rguenther@suse.de> Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] testsuite: Fix up pr111309-2.c on arm [PR111309] Message-ID: <ZVxuwE3jA7cIIf71@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: Jakub Jelinek <jakub@redhat.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783162754713208915 X-GMAIL-MSGID: 1783162754713208915 |
Series |
testsuite: Fix up pr111309-2.c on arm [PR111309]
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jakub Jelinek
Nov. 21, 2023, 8:48 a.m. UTC
Hi! ARM defaults to -fshort-enums and the following testcase FAILs there in 2 lines. The difference is that in C++, E0 has enum E type, which normally has unsigned int underlying type, so it isn't int nor something that promotes to int, which is why we diagnose it (in C it is promoted to int). But with -fshort-enums, the underlying type is unsigned char in that case, which promotes to int just fine. The following patch adjusts the expectations, such that we don't expect it on arm or when people manually test with -fshort-enums. Tested on x86_64-linux and i686-linux, ok for trunk? 2023-11-21 Jakub Jelinek <jakub@redhat.com> PR c/111309 * c-c++-common/pr111309-2.c (foo): Don't expect errors for C++ with -fshort-enums if second argument is E0. Jakub
Comments
On Tue, 21 Nov 2023, Jakub Jelinek wrote: > Hi! > > ARM defaults to -fshort-enums and the following testcase FAILs there in 2 > lines. The difference is that in C++, E0 has enum E type, which normally > has unsigned int underlying type, so it isn't int nor something that > promotes to int, which is why we diagnose it (in C it is promoted to int). > But with -fshort-enums, the underlying type is unsigned char in that case, > which promotes to int just fine. > > The following patch adjusts the expectations, such that we don't expect > it on arm or when people manually test with -fshort-enums. > > Tested on x86_64-linux and i686-linux, ok for trunk? OK > 2023-11-21 Jakub Jelinek <jakub@redhat.com> > > PR c/111309 > * c-c++-common/pr111309-2.c (foo): Don't expect errors for C++ with > -fshort-enums if second argument is E0. > > --- gcc/testsuite/c-c++-common/pr111309-2.c.jj 2023-11-14 10:52:16.191276028 +0100 > +++ gcc/testsuite/c-c++-common/pr111309-2.c 2023-11-20 17:52:30.606386073 +0100 > @@ -32,7 +32,7 @@ foo (void) > __builtin_clzg (0U, 2LL); /* { dg-error "does not have 'int' type" } */ > __builtin_clzg (0U, 2U); /* { dg-error "does not have 'int' type" } */ > __builtin_clzg (0U, true); > - __builtin_clzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target c++ } } */ > + __builtin_clzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target { c++ && { ! short_enums } } } } */ > __builtin_ctzg (); /* { dg-error "too few arguments" } */ > __builtin_ctzg (0U, 1, 2); /* { dg-error "too many arguments" } */ > __builtin_ctzg (0); /* { dg-error "has signed type" } */ > @@ -51,7 +51,7 @@ foo (void) > __builtin_ctzg (0U, 2LL); /* { dg-error "does not have 'int' type" } */ > __builtin_ctzg (0U, 2U); /* { dg-error "does not have 'int' type" } */ > __builtin_ctzg (0U, true); > - __builtin_ctzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target c++ } } */ > + __builtin_ctzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target { c++ && { ! short_enums } } } } */ > __builtin_clrsbg (); /* { dg-error "too few arguments" } */ > __builtin_clrsbg (0, 1); /* { dg-error "too many arguments" } */ > __builtin_clrsbg (0U); /* { dg-error "has unsigned type" } */ > > Jakub > >
On Tue, 21 Nov 2023 at 09:48, Jakub Jelinek <jakub@redhat.com> wrote: > > Hi! > > ARM defaults to -fshort-enums and the following testcase FAILs there in 2 > lines. The difference is that in C++, E0 has enum E type, which normally > has unsigned int underlying type, so it isn't int nor something that > promotes to int, which is why we diagnose it (in C it is promoted to int). > But with -fshort-enums, the underlying type is unsigned char in that case, > which promotes to int just fine. > > The following patch adjusts the expectations, such that we don't expect > it on arm or when people manually test with -fshort-enums. > > Tested on x86_64-linux and i686-linux, ok for trunk? > > 2023-11-21 Jakub Jelinek <jakub@redhat.com> > > PR c/111309 > * c-c++-common/pr111309-2.c (foo): Don't expect errors for C++ with > -fshort-enums if second argument is E0. > Thanks for the fix! I keep forgetting about the -fshort-enum difference between arm-linux and arm-eabi targets.... Christophe > --- gcc/testsuite/c-c++-common/pr111309-2.c.jj 2023-11-14 10:52:16.191276028 +0100 > +++ gcc/testsuite/c-c++-common/pr111309-2.c 2023-11-20 17:52:30.606386073 +0100 > @@ -32,7 +32,7 @@ foo (void) > __builtin_clzg (0U, 2LL); /* { dg-error "does not have 'int' type" } */ > __builtin_clzg (0U, 2U); /* { dg-error "does not have 'int' type" } */ > __builtin_clzg (0U, true); > - __builtin_clzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target c++ } } */ > + __builtin_clzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target { c++ && { ! short_enums } } } } */ > __builtin_ctzg (); /* { dg-error "too few arguments" } */ > __builtin_ctzg (0U, 1, 2); /* { dg-error "too many arguments" } */ > __builtin_ctzg (0); /* { dg-error "has signed type" } */ > @@ -51,7 +51,7 @@ foo (void) > __builtin_ctzg (0U, 2LL); /* { dg-error "does not have 'int' type" } */ > __builtin_ctzg (0U, 2U); /* { dg-error "does not have 'int' type" } */ > __builtin_ctzg (0U, true); > - __builtin_ctzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target c++ } } */ > + __builtin_ctzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target { c++ && { ! short_enums } } } } */ > __builtin_clrsbg (); /* { dg-error "too few arguments" } */ > __builtin_clrsbg (0, 1); /* { dg-error "too many arguments" } */ > __builtin_clrsbg (0U); /* { dg-error "has unsigned type" } */ > > Jakub >
--- gcc/testsuite/c-c++-common/pr111309-2.c.jj 2023-11-14 10:52:16.191276028 +0100 +++ gcc/testsuite/c-c++-common/pr111309-2.c 2023-11-20 17:52:30.606386073 +0100 @@ -32,7 +32,7 @@ foo (void) __builtin_clzg (0U, 2LL); /* { dg-error "does not have 'int' type" } */ __builtin_clzg (0U, 2U); /* { dg-error "does not have 'int' type" } */ __builtin_clzg (0U, true); - __builtin_clzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target c++ } } */ + __builtin_clzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target { c++ && { ! short_enums } } } } */ __builtin_ctzg (); /* { dg-error "too few arguments" } */ __builtin_ctzg (0U, 1, 2); /* { dg-error "too many arguments" } */ __builtin_ctzg (0); /* { dg-error "has signed type" } */ @@ -51,7 +51,7 @@ foo (void) __builtin_ctzg (0U, 2LL); /* { dg-error "does not have 'int' type" } */ __builtin_ctzg (0U, 2U); /* { dg-error "does not have 'int' type" } */ __builtin_ctzg (0U, true); - __builtin_ctzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target c++ } } */ + __builtin_ctzg (0U, E0); /* { dg-error "does not have 'int' type" "" { target { c++ && { ! short_enums } } } } */ __builtin_clrsbg (); /* { dg-error "too few arguments" } */ __builtin_clrsbg (0, 1); /* { dg-error "too many arguments" } */ __builtin_clrsbg (0U); /* { dg-error "has unsigned type" } */