]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: add testcase to test component_ref and constructor codes in eval_constant_expr...
authorFaisal Abbas <90.abbasfaisal@gmail.com>
Sun, 4 Sep 2022 15:18:40 +0000 (16:18 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 31 Jan 2023 13:16:51 +0000 (14:16 +0100)
gcc/testsuite/ChangeLog:

* rust/compile/const7.rs: New test.

Signed-off-by: Faisal Abbas <90.abbasfaisal@gmail.com>
gcc/testsuite/rust/compile/const7.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/const7.rs b/gcc/testsuite/rust/compile/const7.rs
new file mode 100644 (file)
index 0000000..a7431c0
--- /dev/null
@@ -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;
+}
+