diff options
author | Faisal Abbas <90.abbasfaisal@gmail.com> | 2022-09-04 16:18:40 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2023-01-31 14:16:51 +0100 |
commit | b0ff1647cbe682b681ab9abaed3315b6b03c20fc (patch) | |
tree | 965eba18a4d5feffae914ce728db46dddc490079 | |
parent | 689a5c6711b8217158988763ba25959f8112dcfc (diff) | |
download | gcc-b0ff1647cbe682b681ab9abaed3315b6b03c20fc.zip gcc-b0ff1647cbe682b681ab9abaed3315b6b03c20fc.tar.gz gcc-b0ff1647cbe682b681ab9abaed3315b6b03c20fc.tar.bz2 |
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>
-rw-r--r-- | gcc/testsuite/rust/compile/const7.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/const7.rs b/gcc/testsuite/rust/compile/const7.rs new file mode 100644 index 0000000..a7431c0 --- /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; +} + |