From patchwork Tue Jan 30 12:06:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 194059 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1179593dyb; Tue, 30 Jan 2024 04:21:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJoYDNOHk7eGCvQC/gcEx4ysShTe2AgF0bEtWB9NZywcXL5LGEeaZ+/a78ld3TdFNyk47v X-Received: by 2002:ae9:f715:0:b0:783:da2a:3e66 with SMTP id s21-20020ae9f715000000b00783da2a3e66mr7450276qkg.47.1706617297308; Tue, 30 Jan 2024 04:21:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706617297; cv=pass; d=google.com; s=arc-20160816; b=aL+KkeYtHtn/8t7hfBSdPNBnfUkUxWEoSKFBE7EY2L4TYAV9FHwWdf/YvaEq8GOMvE PkgLy083WFAMThmiHQ3/tzioVaEQmSuorfJttt+C0Otnw47pt7I4Xkc40wu2te6lpgLY wqbeSgy7HCAVbQ4SdI2raiCqtd+XADGStai89Dc2E0oWSopXODZIehPJYpLzLYDg4SAc dtWQGQnldS08/buQbKwVKbSsF4OapPe0uwpefOG9EHOTcrgH1d5RKZ6ChpgIHujevRTK TuZ3ChkBa3mDj9tUResFX0DjM7ef0qC05zcB+8SS6dFi6mot43L1y6+7PG/wv6p273bA 9YqA== 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-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=XkkwHu6Cy0ALhtrXjmLMxM1tFV9jr5qIVQo9Cag4UWo=; fh=s1GzlUPo1djGkCl3rkRJI30hDOSCVwGp0RAbVwQ8dxQ=; b=W6mD/uziV7BEiTYSxYp/jcwSumqKy2+aZ1ogVOoY5oAZMISGrnrUcgjetrpgpzhm0e CWkxQiv6RDb+uELzqn1LIOXvLQTEsQZk+dxmNbfghzmCaZVF2z/lM9CmhZ5nkRjIKjbd HSWXNRDw2G4nwAJcrAPOIfXDNKD31YgkR4pk3xExdNbYV9ysIC0BM/RxtUYuJDDLxRg1 wQTPwjgLlMMt85HByKMfx6kSLEgIh48shv4wK9jVP3dwI4elwRNlQpLvr6s98853VfIG oz2Ghrohdv4gONg2o7DiUhpucbuU6DMaTKGYLolgxM6k/K7keireB6zGZ8JDdddXXLlv WOOQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=gRvkTmPn; 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 q13-20020a05620a038d00b00783de2bf730si8740609qkm.498.2024.01.30.04.21.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:21:37 -0800 (PST) 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=@embecosm.com header.s=google header.b=gRvkTmPn; 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 C2A9E385772F for ; Tue, 30 Jan 2024 12:21:28 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 8E0DA3857C42 for ; Tue, 30 Jan 2024 12:11:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E0DA3857C42 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8E0DA3857C42 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616678; cv=none; b=cTgF8+izJpDtgPeLmi2A7OwCYaXO8Sz/gZnzaa0rDIokQG8N0cLbeSj4zHgowJGcVa6qAon+H5K4VQvj/bpM46NP5RjkqPaUJaDLwLW+EVWV3QZ6+gju4k6p25SK/87T9g3dl0UsTQnSFd76lWPUIjESSi91rV8aDDHrss7Yr54= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616678; c=relaxed/simple; bh=OQQV4N/cpNjrh7EOYN15seiSY9fGWW1hE1l0dp5Sz+8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EgrkoK7thKdJW5/VS6DhaGZBGlycRSlbdHPQp9Se9kDWKiYrFqCYQPa0aW0/rkcgZwuxw9YEJBn6Xvu8ydE3yqDYHyaxHVLxemt3aJRGxwmPJUtEFgIrogQDlMsFtmJkJa6fbMQFx7bcEYjPdpCmYpfmMfG4tbD/ZFHpJFrA5nY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40e72a567eeso56787905e9.0 for ; Tue, 30 Jan 2024 04:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616665; x=1707221465; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=XkkwHu6Cy0ALhtrXjmLMxM1tFV9jr5qIVQo9Cag4UWo=; b=gRvkTmPn1FRlVTZxmBSZffiGxBkODx+/uXfhobZh2wYCRLEum2OkD76egxnCkr2o66 1GW9vbJvRgEGDKsn/pqPpYkNMq/mLf76DBoqLNVF22aqqFvSp4y9XBarDuca11zsLTgi 50l93UIDRN1IWbFEdSDG+b3v777T7ww6BvOenQgJ+gkZnvIuow5qj14bLJvHSs7fsne7 ZH8NlmBmeoM7BUBfvgQLUkVvCJoNq0pIHsEZS9VWt/rpr1eAYpnXAf1J1IAbO07eLIgR YcQnWJF2xSzkTCom1GcqdrlWu1fG3RkcJHKrq4z4qa2DAFDVMbphulpsy58Q4KABIrPK dF4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616665; x=1707221465; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=XkkwHu6Cy0ALhtrXjmLMxM1tFV9jr5qIVQo9Cag4UWo=; b=pcQK3foaurzg5EFEr4HAvdqC9RnLBvVWFXTxj0r51hqDt3yansWbXCeX4aVHT+wW2W OZF9X2N9V1WqRoHbWF6fQG4TgPTBTdvoZ5zooJDfY8QrBSQ6W5b8x59s7MJGVKikysjG UpaScKZDto/bV0wgbsS2+BxWvL/hq9Dn+S+YRHvMkkBfCOTRoNazIc+Pv4lS73tBFlNX wO36zSU7kj0EW0mvwDp7VRIyHyVgx1OJzjpzqYpRiRDw+/nhnSBpOnAbMgs7HdcKOQ2X nsupiUn2rIRMdWDE1W3pa5aRixlCrjcYD69Lg1UCkGzDsg7Z2PtEoFEEzoScrmT3GcNb JzrQ== X-Gm-Message-State: AOJu0YzCPFluPErbome2+NarmLWfPxn65pMdPPIWkbxE+ttWsEoxyqcn saUr5SudG41cpEvNNDpdIopr+XueqvMVk/C4rL010pi1+ItAF8LeCEb0ON5s55Nbu7IEY0JnEB0 8Gg== X-Received: by 2002:adf:d1cf:0:b0:33a:ed61:b043 with SMTP id b15-20020adfd1cf000000b0033aed61b043mr5053067wrd.44.1706616665722; Tue, 30 Jan 2024 04:11:05 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id f9-20020a056000036900b00339307d9d31sm10569894wrf.112.2024.01.30.04.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:11:05 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [COMMITTED 022/101] gccrs: Add a test regular variadic functions errors Date: Tue, 30 Jan 2024 13:06:38 +0100 Message-ID: <20240130121026.807464-25-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240130121026.807464-2-arthur.cohen@embecosm.com> References: <20240130121026.807464-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: , Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789517938782179803 X-GMAIL-MSGID: 1789517938782179803 From: Pierre-Emmanuel Patry Add a new regression test for the error message in regular function variadic errors during ast validation pass. gcc/testsuite/ChangeLog: * rust/compile/non_foreign_variadic_function.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/non_foreign_variadic_function.rs | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 gcc/testsuite/rust/compile/non_foreign_variadic_function.rs diff --git a/gcc/testsuite/rust/compile/non_foreign_variadic_function.rs b/gcc/testsuite/rust/compile/non_foreign_variadic_function.rs new file mode 100644 index 00000000000..2a4d3090a66 --- /dev/null +++ b/gcc/testsuite/rust/compile/non_foreign_variadic_function.rs @@ -0,0 +1,4 @@ +pub fn toto(a: i32, ...) {} +// { dg-error "only foreign or .unsafe extern .C.. functions may be C-variadic" "" { target *-*-* } .-1 } + +fn main() {}