From patchwork Wed Apr 5 14:03:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 79709 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp359908vqo; Wed, 5 Apr 2023 07:42:49 -0700 (PDT) X-Google-Smtp-Source: AKy350Y01W9n6COvtr4CVo1Mo+NiDMCYjIZW1Xy1vKE6JKCGUsYIP5gW3inek1MBF/uZB9P3xZqP X-Received: by 2002:a17:906:693:b0:932:8cd:1021 with SMTP id u19-20020a170906069300b0093208cd1021mr3187121ejb.33.1680705769627; Wed, 05 Apr 2023 07:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680705769; cv=none; d=google.com; s=arc-20160816; b=W3BYMvn+YiT2pZhQt0Py+A7Pd4T64G2T78W64fLN3wcDCCH1mPwIQYaLdsTW0BRSv/ 3+I+2b18CM0bRgFmyN/lg8z33ecvrUKYEEreIYQ0GlYCfOU3ubVRJlFKq2BzqU3ZwvZ3 kOmz69CH95wbdoinPIIIlwWZGBQ5J6uQyvuMVpBSp9dIK2XGG5PyxOc4Q3OGqJoUyaS+ Zw++wE+i4/rB+mmUka9qLe2+yejaDSV8YTleX2/xlDrevvTaDNaDBlzPBtxkWxShXtWT dUncHOWUR1hb3QaCHkr6RG4NXkwTmrkkEbZyn4+ODmdix6fsS6wXLOmoK7ZqMuExuQPl 2AdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender: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:dmarc-filter :delivered-to; bh=WlN7u7RgXQgZZ2m1GFUQeOAOSGxK7KPIDiB1VOchWFQ=; b=Rvk1GptLGPctUEEAAn32HB4q7jp0NBnmGHyeKxAZofC6rDxJLns5nDwG3GuOalVsBO QBPRJvhL4a8bsA1XgHC3nytoiCe7L4IG51q5YCo01ByE+elveCUlG/xeYiuMGbf9LSwR KcjvOqHbKdElD5Fr710y8RXiQAYShXhIv0hhlDGBytcAoHrZMTD5DadljzDJ2mJn+wGk JqegIXI9f911r0iF9RxhvNv32pUg7Qz2IA2UmfmnHasRcRaa5jGWnrPPXx9RsWOnre7g +qAMAKzHnnEb5OkG61J4HgpvEYcqeqs9NoRVd2+zT4dlFIlEvL6H87HHTCLzzUSBtg5S XhcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=BCuwXFYI; 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" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id f7-20020a170906738700b0092a3709e877si4809914ejl.679.2023.04.05.07.42.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:42:49 -0700 (PDT) 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=@embecosm.com header.s=google header.b=BCuwXFYI; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 325043A47F7C for ; Wed, 5 Apr 2023 14:15:24 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 84230388203F for ; Wed, 5 Apr 2023 14:06:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 84230388203F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x336.google.com with SMTP id n19so20972530wms.0 for ; Wed, 05 Apr 2023 07:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1680703577; 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=WlN7u7RgXQgZZ2m1GFUQeOAOSGxK7KPIDiB1VOchWFQ=; b=BCuwXFYI33yifzstpObYDE74UG2IcRtReu5Ey7sZgFWvUP+jehJEYHLDIQHj8URlc1 ZRLzjv6Z1NatFYylmJi13NKnnCOqdXX2PRj/b7riZxMEhrDkyl9WMy9dfTRZ6axgFQIv 9UYiyI1eHxCTTcAuEibCI3hmDRRcyzdpWMO93YNqMlQS6L5iOlL7uWEfTOBxgqahYV4b JbDlsuXTwwey158Tmxr8Lgd7F729elgYIAG1ZSSmG3SOPiVagVhU2+TqOahSDiZ7k0Un rFj8zqhYWVlaot5Tz2sEvXqdFNNx39LB/vDnoLTh/kG1vcai8NtVr/n6S3yylPs+eA4y me3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680703577; 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=WlN7u7RgXQgZZ2m1GFUQeOAOSGxK7KPIDiB1VOchWFQ=; b=C+aCXtc45nuvNpTs+TnjMONgf6Ih867GBL78LLXCH9/Vga49w4MxSOT6GUnKHS8qYD jCF3RmgcfIwWpp6iv/JfjEKICcw3taIq3kdktM2WKD4Kov63Mo1q5OkXnkfeabYMSTpq Gx7nYskHjrebA0LKrCuy7F6kyLmbpEOaUoQiIxb421pOJ6TDPfv/OAlR0MiO+ucEO0lI mx8ezPYsD13KB2uaRYj+VjkVaiXyLsH6/O76m+EScdmV9m6KlzBk2LuvR+s1wGxNYivD LdE6etVE16vOoV7Sb3l88mS7HPGmGCJ8E0k4wL9p4ECZd9iy9GdSoPkRPyNiidDQoM3Y knfw== X-Gm-Message-State: AAQBX9cphYmOLNlC5w9RSbmgAExYXWPOgmDV22LPOBEcPAa8ZZuEb4q8 zJjQiQIje7POM0RjsA+5PmdPmmAJQzAEgBtZIw== X-Received: by 2002:a05:600c:b4f:b0:3ed:d64f:ec30 with SMTP id k15-20020a05600c0b4f00b003edd64fec30mr4624309wmr.33.1680703577763; Wed, 05 Apr 2023 07:06:17 -0700 (PDT) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id ay8-20020a05600c1e0800b003edddae1068sm2330150wmb.9.2023.04.05.07.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:06:17 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [committed 70/88] gccrs: testsuite: Add empty string macro test Date: Wed, 5 Apr 2023 16:03:54 +0200 Message-Id: <20230405140411.3016563-71-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230405140411.3016563-1-arthur.cohen@embecosm.com> References: <20230405140411.3016563-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.2 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 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.29 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 Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762347733219613971?= X-GMAIL-MSGID: =?utf-8?q?1762347733219613971?= From: Pierre-Emmanuel Patry Add two new tests with empty string for include_str and include_bytes macros. gcc/testsuite/ChangeLog: * rust/compile/issue-1830_bytes.rs: New test. * rust/compile/issue-1830_str.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/issue-1830_bytes.rs | 8 ++++++++ gcc/testsuite/rust/compile/issue-1830_str.rs | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/rust/compile/issue-1830_bytes.rs create mode 100644 gcc/testsuite/rust/compile/issue-1830_str.rs diff --git a/gcc/testsuite/rust/compile/issue-1830_bytes.rs b/gcc/testsuite/rust/compile/issue-1830_bytes.rs new file mode 100644 index 00000000000..dcc53b73b19 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-1830_bytes.rs @@ -0,0 +1,8 @@ +#[rustc_builtin_macro] +macro_rules! include_bytes { + () => {{}}; +} + +fn main() { + include_bytes!(""); // { dg-excess-errors "Is a directory" } +} diff --git a/gcc/testsuite/rust/compile/issue-1830_str.rs b/gcc/testsuite/rust/compile/issue-1830_str.rs new file mode 100644 index 00000000000..6cf835ba9bd --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-1830_str.rs @@ -0,0 +1,8 @@ +#[rustc_builtin_macro] +macro_rules! include_str { + () => {{}}; +} + +fn main() { + include_str!(""); // { dg-excess-errors "Is a directory" } +}