From patchwork Wed Oct 11 16:53:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 151476 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp677788vqb; Wed, 11 Oct 2023 09:54:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiDoNudiI2FLYntIE4Z5/YwK8Zj3KAllXZ89zUavYgPytvOz3g1EJ15K2TuOlzXKz7ZGpy X-Received: by 2002:a05:6402:344a:b0:525:bbc0:2a8c with SMTP id l10-20020a056402344a00b00525bbc02a8cmr19580585edc.33.1697043265262; Wed, 11 Oct 2023 09:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697043265; cv=none; d=google.com; s=arc-20160816; b=eCE3rIpXUjzII7hrGZ7QO95FVKeD/wZn9Q9H4HHDK09SVpWi7OmFJmUPCIPBWu/aVt wjud7ode0fROVOxNdr/fbfNNYlFYkbQUGKp5V4Fgrv4zFz7Ok1y8/9/aRK3HOtvSrZfO z/1lUWWUr4eHl1snO39AVojOLNKfs3sL5hMS0aIR91OfjTXvVNvZdYHpANbhFUIEN7Ms blPGo//k/s8vbcR61vqnSdlfnlxOPrnpEskbzt0fuoPS5gwHP8w/ihThzqEvJiPksyVN 8HfpY+RCpponhHX3yimfo/WeSQAIV6rACUDRz3KwPUQWGeGj+71v4VvpStfqiiptKjwZ W0oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:date:subject:to:from:dkim-signature:dmarc-filter :delivered-to; bh=zYM1efSPYM9l0okZgT/pKpgbcuRb8gr6VIt5X+k2z74=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=TavR5Wz8SSS4d7AuARMmlG+zIAdq6powcvHGvXQzEYuufSxNACXkrhxzzsL2L9Eoo9 qNfKFp9hLgt1R2sHURPkKxqhtWaM8p4i3T3lEld2mHv/mNFJGgotQ5+f+6zn/dENb2cy KLenIPoPaTilWoGlD1+yjU0RtE80DUIuZQAcZnI1PtvYBQ0unhoUcqSqk6GDlutDBWpT vQZCzoq5u7IJPGXT2HgGss9BAbv89ncMoGaRSsd/HqaWPkbuQwlPi58nv0FZDfHuYnZd Wrs19DuiSAjm42WdBIO+PlwqNIVauRrBrDFQbY9Nhzg4kB94lYzL+ersZjiYMgyJG7ej oGoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MnHz0uvU; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id y26-20020a056402135a00b00533dda15911si6492987edw.126.2023.10.11.09.54.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 09:54:25 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MnHz0uvU; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 D7C31385700D for ; Wed, 11 Oct 2023 16:54:15 +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 D1C783858C52 for ; Wed, 11 Oct 2023 16:53:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D1C783858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697043231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=zYM1efSPYM9l0okZgT/pKpgbcuRb8gr6VIt5X+k2z74=; b=MnHz0uvUSTBqMcfKlgGE2ENdrW0x2suidGri0skhVPL3bZ2tMJ2gpKhJDNc+KsayA8UckI FVWqKCbCxct567Csq1IjUhhKjgF0XkqWI6AseLBNl/xQ3y73LVYsOgRfPadqp65g0ugcfp ru65IL2aF6TqnuSW04zLll1T5ZInhpE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-SE3arZ6INB-TuIE1dsewbg-1; Wed, 11 Oct 2023 12:53:50 -0400 X-MC-Unique: SE3arZ6INB-TuIE1dsewbg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E75D8805B3E for ; Wed, 11 Oct 2023 16:53:49 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7659410F1BE7 for ; Wed, 11 Oct 2023 16:53:49 +0000 (UTC) From: Florian Weimer To: gcc-patches@gcc.gnu.org Subject: [PATCH] C99 test suite conversation: Some unverified test case adjustments Date: Wed, 11 Oct 2023 18:53:48 +0200 Message-ID: <87zg0pt80z.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779478839137536103 X-GMAIL-MSGID: 1779478839137536103 These changes are assumed not to interfere with the test objective, but it was not possible to reproduce the historic test case failures (with or without the modification here). gcc/testsuite/ * gcc.c-torture/compile/20000105-1.c: Add missing int return type. Call __builtin_exit instead of exit. * gcc.c-torture/compile/20000105-2.c: Add missing void types. * gcc.c-torture/compile/20000211-1.c (Lstream_fputc, Lstream_write) (Lstream_flush_out, parse_doprnt_spec): Add missing function declaration. * gcc.c-torture/compile/20000224-1.c (call_critical_lisp_code): Declare. * gcc.c-torture/compile/20000314-2.c: Add missing void types. * gcc.c-torture/compile/20090917-1.c (foo): Likewise. * gcc.c-torture/compile/980816-1.c (XtVaCreateManagedWidget) (XtAddCallback): Likewise. * gcc.c-torture/compile/pr49474.c: Use struct gfc_formal_arglist * instead of (implied) int type. * gcc.c-torture/execute/20001111-1.c (foo): Add cast to char *. (main): Call __builtin_abort and __builtin_exit. --- gcc/testsuite/gcc.c-torture/compile/20000105-1.c | 5 +++-- gcc/testsuite/gcc.c-torture/compile/20000105-2.c | 3 ++- gcc/testsuite/gcc.c-torture/compile/20000211-1.c | 4 ++++ gcc/testsuite/gcc.c-torture/compile/20000224-1.c | 1 + gcc/testsuite/gcc.c-torture/compile/20000314-2.c | 3 ++- gcc/testsuite/gcc.c-torture/compile/980816-1.c | 2 ++ gcc/testsuite/gcc.c-torture/compile/pr49474.c | 3 ++- gcc/testsuite/gcc.c-torture/execute/20001111-1.c | 8 ++++---- 8 files changed, 20 insertions(+), 9 deletions(-) base-commit: ca11744f8c1e5e1cb231b0477236c5f341a66035 diff --git a/gcc/testsuite/gcc.c-torture/compile/20000105-1.c b/gcc/testsuite/gcc.c-torture/compile/20000105-1.c index 6f389d88b22..1917b2b6656 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20000105-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20000105-1.c @@ -1,14 +1,15 @@ +int main(int na, char* argv[]) { int wflg = 0, tflg = 0; int dflg = 0; - exit(0); + __builtin_exit(0); while(1) { switch(argv[1][0]) { help: - exit(0); + __builtin_exit(0); case 'w': case 'W': wflg = 1; diff --git a/gcc/testsuite/gcc.c-torture/compile/20000105-2.c b/gcc/testsuite/gcc.c-torture/compile/20000105-2.c index 7689395f45d..74bee07144a 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20000105-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/20000105-2.c @@ -1,4 +1,5 @@ -foo () +void +foo (void) { long long int i = (int) ""; } diff --git a/gcc/testsuite/gcc.c-torture/compile/20000211-1.c b/gcc/testsuite/gcc.c-torture/compile/20000211-1.c index b83d6a40520..c6b6c245dc9 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20000211-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20000211-1.c @@ -46,6 +46,10 @@ typedef struct typedef struct { } printf_arg_dynarr; +extern void Lstream_fputc (struct lstream *, int); +extern void Lstream_write (struct lstream *, const Bufbyte *, Bytecount); +extern void Lstream_flush_out (struct lstream *); +extern printf_spec_dynarr *parse_doprnt_spec (Bufbyte *, Bytecount); static void doprnt_1 (Lisp_Object stream, const Bufbyte *string, Bytecount len, Charcount minlen, Charcount maxlen, int minus_flag, int zero_flag) diff --git a/gcc/testsuite/gcc.c-torture/compile/20000224-1.c b/gcc/testsuite/gcc.c-torture/compile/20000224-1.c index 1c72b6accab..085c33fd206 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20000224-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20000224-1.c @@ -21,6 +21,7 @@ union Lisp_Object } Lisp_Object; extern int initialized; +extern void call_critical_lisp_code (Lisp_Object); void init_device_faces (int *d) { diff --git a/gcc/testsuite/gcc.c-torture/compile/20000314-2.c b/gcc/testsuite/gcc.c-torture/compile/20000314-2.c index 3fdb3c3a857..0ec8181e6df 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20000314-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/20000314-2.c @@ -1,6 +1,7 @@ extern void malloc(__SIZE_TYPE__ size); -toto() +void +toto(void) { malloc(100); } diff --git a/gcc/testsuite/gcc.c-torture/compile/980816-1.c b/gcc/testsuite/gcc.c-torture/compile/980816-1.c index 5bd83b17063..ae942147c4b 100644 --- a/gcc/testsuite/gcc.c-torture/compile/980816-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/980816-1.c @@ -16,6 +16,8 @@ typedef void (*XtCallbackProc)( extern const char XtStrings[]; +extern Widget XtVaCreateManagedWidget(const char *, WidgetClass, Widget, ...); +extern void XtAddCallback(const char *, XtCallbackProc, XtPointer); typedef struct { diff --git a/gcc/testsuite/gcc.c-torture/compile/pr49474.c b/gcc/testsuite/gcc.c-torture/compile/pr49474.c index 0368ccb02fa..01fe0b113e7 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr49474.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr49474.c @@ -1,8 +1,9 @@ typedef struct gfc_formal_arglist { - int next; + struct gfc_formal_arglist* next; } gfc_actual_arglist; +struct gfc_formal_arglist* update_arglist_pass (gfc_actual_arglist* lst, int po, unsigned argpos, const char *name) { diff --git a/gcc/testsuite/gcc.c-torture/execute/20001111-1.c b/gcc/testsuite/gcc.c-torture/execute/20001111-1.c index 85617c23d44..30c8558efba 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20001111-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20001111-1.c @@ -16,7 +16,7 @@ foo (unsigned int offset) return i * 0xce2f; buffer = next_buffer; - data = buffer * 0xce2f; + data = (char *) (buffer * 0xce2f); for (i = 0; i < 2; i++) bar (); buffer = next_buffer; @@ -33,9 +33,9 @@ int main () { if (foo (3) != 3) - abort (); + __builtin_abort (); next_buffer = 1; if (foo (2) != 0xce2f + 2) - abort (); - exit (0); + __builtin_abort (); + __builtin_exit (0); }