From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7905) id AF682385781A; Tue, 31 Jan 2023 13:16:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF682385781A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675170963; bh=jk+CejerQdULtEcOl29wS+52xa/dxCF37df0iZeNQzs=; h=From:To:Subject:Date:From; b=UDnp4Iy8Mj8C3JZcKb5Cn0pz2nd9SwAmAMQo4HYtG8Sjxq5QlKtxPmwB4g5mfvioV 0O0w0Ry2OWY6g0ZLl3TE1VD30hkw81Lr1BhQ5CI49KXX44YVI76ughILRfFF7ASCrj yo5qSWfl+R7RzNwtT2QCbQDwMs/7/AAcQ1vBNh3Y= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Arthur Cohen To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5555] gccrs: add testcase to test component_ref and constructor codes in eval_constant_expression() X-Act-Checkin: gcc X-Git-Author: Faisal Abbas <90.abbasfaisal@gmail.com> X-Git-Refname: refs/heads/master X-Git-Oldrev: 689a5c6711b8217158988763ba25959f8112dcfc X-Git-Newrev: b0ff1647cbe682b681ab9abaed3315b6b03c20fc Message-Id: <20230131131603.AF682385781A@sourceware.org> Date: Tue, 31 Jan 2023 13:16:03 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b0ff1647cbe682b681ab9abaed3315b6b03c20fc commit r13-5555-gb0ff1647cbe682b681ab9abaed3315b6b03c20fc Author: Faisal Abbas <90.abbasfaisal@gmail.com> Date: Sun Sep 4 16:18:40 2022 +0100 gccrs: add testcase to test component_ref and constructor codes in eval_constant_expression() gcc/testsuite/ChangeLog: * rust/compile/const7.rs: New test. Signed-off-by: Faisal Abbas <90.abbasfaisal@gmail.com> Diff: --- gcc/testsuite/rust/compile/const7.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gcc/testsuite/rust/compile/const7.rs b/gcc/testsuite/rust/compile/const7.rs new file mode 100644 index 00000000000..a7431c0c4d2 --- /dev/null +++ b/gcc/testsuite/rust/compile/const7.rs @@ -0,0 +1,12 @@ +// { dg-options "-w -O0 -fdump-tree-gimple" } +struct Foo(usize, usize); + +const A:Foo = Foo(123, 4546); + +const B:usize = A.0; + +fn main() { + // { dg-final { scan-tree-dump-times {b = 123} 1 gimple } } + let b = B; +} +