public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Enhance #1426 "Invalid recursive :stmt expansion in fragment specifiers" test case Date: Tue, 9 Aug 2022 20:38:49 +0000 (GMT) [thread overview] Message-ID: <20220809203849.C55C03856DE5@sourceware.org> (raw) https://gcc.gnu.org/g:23702abda4ec44466f65581391ba9c0eae3f13f6 commit 23702abda4ec44466f65581391ba9c0eae3f13f6 Author: Thomas Schwinge <thomas@codesourcery.com> Date: Sat Aug 6 13:13:40 2022 +0200 Enhance #1426 "Invalid recursive :stmt expansion in fragment specifiers" test case ... that was recently added in #1429 commit 9fc6a27b5c6ea2c775646c4474b9084da76b1764 "expand: correctly handles non-macro nodes ...". - Rename 'macro-issue1403.rs' -> 'macro-issue1426.rs'. - Get rid of '-w'; expect diagnostic instead. - Get rid of debugging options not relevant here. - Get rid of explicit '-O1'; make it a "torture" test case. - Replace always-matching 'scan-assembler "14"' ("14" appears in the crate name) with directed dump scanning. - ..., just not for '-O0', where such optimization is not done. Diff: --- .../compile/{macro-issue1403.rs => torture/macro-issue1426.rs} | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/rust/compile/macro-issue1403.rs b/gcc/testsuite/rust/compile/torture/macro-issue1426.rs similarity index 63% rename from gcc/testsuite/rust/compile/macro-issue1403.rs rename to gcc/testsuite/rust/compile/torture/macro-issue1426.rs index 756d374e25c..1b558cfa83d 100644 --- a/gcc/testsuite/rust/compile/macro-issue1403.rs +++ b/gcc/testsuite/rust/compile/torture/macro-issue1426.rs @@ -1,5 +1,5 @@ -// { dg-do compile } -// { dg-options "-O1 -gdwarf-5 -dA -w" } +// { dg-additional-options -fdump-tree-ccp1-raw } + macro_rules! stmt { ($s:stmt) => { $s @@ -13,6 +13,7 @@ macro_rules! stmt { pub fn test() -> i32 { stmt!( let a = 1 + // { dg-warning {unused name 'a'} {} { target *-*-* } .-1 } ); stmt!( let b = 2, @@ -21,8 +22,8 @@ pub fn test() -> i32 { let e = 5, let f = b + c + d + e ); - // { dg-final { scan-assembler "14" } } f + // { dg-final { scan-tree-dump-times {gimple_return <14>} 1 ccp1 { target __OPTIMIZE__ } } } } fn main() {
reply other threads:[~2022-08-09 20:38 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220809203849.C55C03856DE5@sourceware.org \ --to=tschwinge@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).