From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 C53263858D28 for ; Tue, 31 Jan 2023 12:34:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C53263858D28 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=1675168471; 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:in-reply-to:in-reply-to: references:references; bh=rZB3+G57hHo5YTBOaGbS5wN/Jo0AvZDLk80KDHZgY28=; b=SGjUgHJ6j0v+ZzeDIR0XP5Uwvosg2su6hJixBKbG4SeWKEyAg/IB+T6QFcKj2f5koz0ybI eL6shrIpxpdjgcr8+VrjC26uqsaWkMvO/ErwH5gZqrbyq5ipwmXyWGUSuEv0ss5uHyJVLN KNdcxbGB98Y1QL3qXzb8HGReMDWMyhE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-f3jfL-EhPNOqUaHAH7GGpg-1; Tue, 31 Jan 2023 07:34:30 -0500 X-MC-Unique: f3jfL-EhPNOqUaHAH7GGpg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A400B2999B25; Tue, 31 Jan 2023 12:34:29 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6300C422F2; Tue, 31 Jan 2023 12:34:29 +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 30VCYQbi1045918 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 31 Jan 2023 13:34:27 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 30VCXfox1045913; Tue, 31 Jan 2023 13:33:41 +0100 Date: Tue, 31 Jan 2023 13:33:41 +0100 From: Jakub Jelinek To: Siddhesh Poyarekar Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 1/2] testsuite: Run __bos tests to completion Message-ID: Reply-To: Jakub Jelinek References: <20221221222554.4141678-1-siddhesh@gotplt.org> <20221221222554.4141678-2-siddhesh@gotplt.org> MIME-Version: 1.0 In-Reply-To: <20221221222554.4141678-2-siddhesh@gotplt.org> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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.8 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_H2,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 List-Id: On Wed, Dec 21, 2022 at 05:25:53PM -0500, Siddhesh Poyarekar wrote: > gcc/testsuite/ChangeLog: > > * gcc.dg/builtin-dynamic-object-size-0.c: Move FAIL and nfail > into... > * gcc.dg/builtin-object-size-common.h: ... new file. > * g++.dg/ext/builtin-object-size1.C: Include > builtin-object-size-common.h. Replace all abort with FAIL. > (main): Call DONE. > * g++.dg/ext/builtin-object-size2.C: Likewise. > * gcc.dg/builtin-object-size-1.c: Likewise. > * gcc.dg/builtin-object-size-12.c: Likewise. > * gcc.dg/builtin-object-size-13.c: Likewise. > * gcc.dg/builtin-object-size-15.c: Likewise. > * gcc.dg/builtin-object-size-2.c: Likewise. > * gcc.dg/builtin-object-size-3.c: Likewise. > * gcc.dg/builtin-object-size-4.c: Likewise. > * gcc.dg/builtin-object-size-6.c: Likewise. > * gcc.dg/builtin-object-size-7.c: Likewise. > * gcc.dg/builtin-object-size-8.c: Likewise. > * gcc.dg/pr101836.c: Likewise. > * gcc.dg/strict-flex-array-3.c: Likewise. > --- a/gcc/testsuite/g++.dg/ext/builtin-object-size1.C > +++ b/gcc/testsuite/g++.dg/ext/builtin-object-size1.C > @@ -1,8 +1,9 @@ > // { dg-do run } > // { dg-options "-O2" } > > +#include "../../gcc.dg/builtin-object-size-common.h" > + > typedef __SIZE_TYPE__ size_t; > -extern "C" void abort (); > extern "C" void exit (int); > extern "C" void *malloc (size_t); > extern "C" void free (void *); I'd then wonder if size_t shouldn't be typedefed and perhaps even exit/malloc/free etc. shouldn't be prototyped in builtin-object-size-common.h too (of course, with extern "C" conditionalized on __cplusplus). > if (__builtin_object_size (r + 6, 0) != res - 6) > - abort (); > + FAIL (); There should be a tab, not 8 spaces. > @@ -335,13 +336,13 @@ test2 (void) > if (res >= 12) > { > if (__builtin_object_size (r + 12, 0) != res - 12) > - abort (); > + FAIL (); Ditto. > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/builtin-object-size-common.h > @@ -0,0 +1,12 @@ > +unsigned nfails = 0; > + > +#define FAIL() ({ \ > + __builtin_printf ("Failure at line: %d\n", __LINE__); \ > + nfails++; \ > +}) > + > +#define DONE() ({ \ > + if (nfails > 0) \ > + __builtin_abort (); \ > + return 0; \ > +}) Why the statement expressions? do { and } while (0) would work too... > - printf("WAT: %s == %zd (expected %zd)\n", #p, p, v); \ > - __builtin_abort (); \ > + __builtin_printf("WAT: %s == %zd (expected %zd)\n", #p, p, v); \ > + FAIL (); \ The above has rightly indented FAIL, but the line before that uses 10 spaces rather than tab + 2 spaces. Otherwise LGTM. Jakub