Message ID | 20230721151626.67206-1-siddhesh@gotplt.org |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp277622vqg; Fri, 21 Jul 2023 08:17:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlFfD3P8atgr4aEiP9dIVQF9mfnqDOTJt3RQ8asu5rHI0mW3mCOlWzUHJEcC7JpaKg9Zr5vX X-Received: by 2002:a17:907:6d8c:b0:98d:abd4:4000 with SMTP id sb12-20020a1709076d8c00b0098dabd44000mr8733171ejc.35.1689952672880; Fri, 21 Jul 2023 08:17:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689952672; cv=pass; d=google.com; s=arc-20160816; b=T8689DXBMaFTGb+dMxptvlXsy3sQ+dxi6k0krGbR9DlOsp5CBwMxjIi4d50i55lbif 5+U0oyEdhlp2E6cr7qlhByNPYuIJQGcwUjVPloCV9kPL06updXb+NdG7RXcWMzg2SMfs i0tuQkXS9H/X8ngqflj/yci9OAra2hWuL/QMhrcGT0SwRDIg8RRAcmonjWls1teszSbP uD5ZVSrcQJO1y3i6C9YzpfFCzczjPmNDTJ2u6LIlyAIYO7DNYmlTT5SPDxqaMII4Eg9W eo6OQBRPWX+GfWq942Y9dF/l5Z7ass4fMe/V6CqzakZwOSP/9K5G9riJQuDrlkYxjMel Ty5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dmarc-filter:delivered-to; bh=/nIUkF2yz13fPuYvSencU2spj5KvGKz40mTJexrbjuQ=; fh=+xvxYTDdYui3bDWERkurLqCShBBpCSoH+AZc21xGWeg=; b=ePuRteI9odWIPd6Y9QAoPEaBLlk2Z3XqH30YC1guKfE7WFYDtnqVH9rRlponS8PiKH jTWTv8Sd4+yi+7NTU7s5JrIqZEve2hkFkTqZKbuva8biYvex58aK36oU649Qh30VebmI kCtnc9T7eZUr01DXFpBWc5NZ9QmnNk9MN8MZNHllWKZgMZnc/NXfXxpaX1joJiugNbKX yPggyw432O3dqylYyQWjsPKeirVIO/H7CmPvP6kH0avis2YkgdL+GU7L0+zOmhwiogVz oEEHB/+b1uHRWtSHn81wsbiuIZI22KVyD16FQlya38VmFRhLuGyvzXQJnHrAMXMDTAli W15g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gotplt.org header.s=dreamhost header.b=SDjRR2HF; arc=pass (i=1); 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" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a6-20020a170906368600b00992d772e984si2233383ejc.184.2023.07.21.08.17.52 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 08:17:52 -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=@gotplt.org header.s=dreamhost header.b=SDjRR2HF; arc=pass (i=1); 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 481113860015 for <ouuuleilei@gmail.com>; Fri, 21 Jul 2023 15:17:17 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from buffalo.ash.relay.mailchannels.net (buffalo.ash.relay.mailchannels.net [23.83.222.24]) by sourceware.org (Postfix) with ESMTPS id A4D0E3853D09 for <gcc-patches@gcc.gnu.org>; Fri, 21 Jul 2023 15:16:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A4D0E3853D09 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 3A0E54C119A; Fri, 21 Jul 2023 15:16:46 +0000 (UTC) Received: from pdx1-sub0-mail-a286.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id D0D784C1BAA; Fri, 21 Jul 2023 15:16:45 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1689952605; a=rsa-sha256; cv=none; b=diKJP+w6M2A/imKrK+H0ReiKgfOMDjeHUkjtfEUFTVgZ99BteAKiJ5Oke2jK68yi0Anuss Q+Qy0eF3fD5xcyig/7xOvYGvdKKRkujET92xnPBrn0K+wzYbwu+k8g7rD0BKmVwTRqzTwZ gsFMb0TYJuvvTI/ySo+ISfHVKZw8hE2KjN2yxyKOJSp6fT5v+hgGcWQGj7ohH227ICoO2b wW3ERsJVM4etydC+OKHyUweHymNwF2NCmb/pQ1lBaK7flGzde+TGdWxv5r82tiGWCqFpa+ nt4RF+qR0sA8h5UQUCwTtDDvCPjfpWdrTwk5anz3Q7sm3Tc5p3DLNcX3T+BDaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1689952605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=/nIUkF2yz13fPuYvSencU2spj5KvGKz40mTJexrbjuQ=; b=JUqNekXXOzm18J5l8AIlSD/tnqXxUP6YX9ygCjHrfUFP+/7Ll3HvgsK8r0m7FeHDSNksB3 tVdqParLYcUiQmfMi6QuD6WiZkEjMThtzDtJgKB8Sb2FVczhq1B2q9NT4PtdYgt8fFWPV7 GA2p11T3mR9CA106HeEFmTW9qB8ETIgM96QRqvMdZ+bJwS/ZWB0EgVETUoxWPWI20fXl6e ciW61mA3sG1dOnp6pZKlgYCw6zO2gktm9cG9YbzdlPVd1AgSNYUvLQq3T1tMnvZDZHUKed mNEZSuJIdBqsvCe/raqN8uIIuor5fdY//kbBYA4bu46ZDJ+UckE6kSdn0Puj4w== ARC-Authentication-Results: i=1; rspamd-59bd44d99d-rgxwv; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Broad-White: 4483add101854df5_1689952606074_820548949 X-MC-Loop-Signature: 1689952606074:1128580111 X-MC-Ingress-Time: 1689952606074 Received: from pdx1-sub0-mail-a286.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.107.136.31 (trex/6.9.1); Fri, 21 Jul 2023 15:16:46 +0000 Received: from fedora.. (bras-vprn-toroon4834w-lp130-09-174-91-45-44.dsl.bell.ca [174.91.45.44]) (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) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a286.dreamhost.com (Postfix) with ESMTPSA id 4R6tSY36XwzNw; Fri, 21 Jul 2023 08:16:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1689952605; bh=/nIUkF2yz13fPuYvSencU2spj5KvGKz40mTJexrbjuQ=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=SDjRR2HF9JFiwWO7rn1c9s159KrIK7ZgcZnbZqr6QVTO3vguLdW/eShuEz2Qs+A86 KOAK8Tv81E3qoNlUm4I36Vx7pxbHSjOQyAoCa0ORWvFj9jfI6pRhRrZGmiqPLyPzMa 18MZHlF73HEPeWg1Pxtx9S580ZlNudk9Gw1Vm53fcjaAarjgIGsoH3Yywo0c3MJkcO I1H0xYIuMaBAG/ieZoP/qkKgsOwW40cqjDIo1A76Y4HKzyYTew2W//dNvWlYfeomeU o+5cHSCUtZ6fLDfgBeR965HZ7LpOIC7qsmDAwxjojYvuifMBGGjZCxGRtiDeqwfCFT 1LsZFmXM0kFIA== From: Siddhesh Poyarekar <siddhesh@gotplt.org> To: gcc-patches@gcc.gnu.org Cc: rguenther@suse.de Subject: [PATCH] testsuite/110763: Ensure zero return from test Date: Fri, 21 Jul 2023 11:16:26 -0400 Message-ID: <20230721151626.67206-1-siddhesh@gotplt.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3036.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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.29 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> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772043813858289714 X-GMAIL-MSGID: 1772043813858289714 |
Series |
testsuite/110763: Ensure zero return from test
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Siddhesh Poyarekar
July 21, 2023, 3:16 p.m. UTC
The test deliberately reads beyond bounds to exersize ubsan and the
return value may be anything, based on previous allocations. The OFF
test caters for it by ANDing the return with 0, do the same for the DYN
test.
gcc/testsuite/ChangeLog:
PR testsuite/110763
* gcc.dg/ubsan/object-size-dyn.c (dyn): New parameter RET.
(main): Use it.
Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
---
gcc/testsuite/gcc.dg/ubsan/object-size-dyn.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On 7/21/23 09:16, Siddhesh Poyarekar wrote: > The test deliberately reads beyond bounds to exersize ubsan and the > return value may be anything, based on previous allocations. The OFF > test caters for it by ANDing the return with 0, do the same for the DYN > test. > > gcc/testsuite/ChangeLog: > > PR testsuite/110763 > * gcc.dg/ubsan/object-size-dyn.c (dyn): New parameter RET. > (main): Use it. OK jeff
diff --git a/gcc/testsuite/gcc.dg/ubsan/object-size-dyn.c b/gcc/testsuite/gcc.dg/ubsan/object-size-dyn.c index 0159f5b9820..49c3abe2e72 100644 --- a/gcc/testsuite/gcc.dg/ubsan/object-size-dyn.c +++ b/gcc/testsuite/gcc.dg/ubsan/object-size-dyn.c @@ -5,12 +5,12 @@ int __attribute__ ((noinline)) -dyn (int size, int i) +dyn (int size, int i, int ret) { __builtin_printf ("dyn\n"); fflush (stdout); int *alloc = __builtin_calloc (size, sizeof (int)); - int ret = alloc[i]; + ret = ret & alloc[i]; __builtin_free (alloc); return ret; } @@ -28,7 +28,7 @@ off (int size, int i, int ret) int main (void) { - int ret = dyn (2, 2); + int ret = dyn (2, 2, 0); ret |= off (4, 4, 0);