diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-05-05 17:48:01 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-05-05 17:48:01 +0000 |
commit | ca361dec8f52c32553ce31f58acb414869b0b7a8 (patch) | |
tree | 25b31da61091c6f507a936a90a2a40d3b14c9a1b /gcc/testsuite | |
parent | fa6aeae1ad6baf1e8e201508c9db8b4df00024df (diff) | |
download | gcc-ca361dec8f52c32553ce31f58acb414869b0b7a8.zip gcc-ca361dec8f52c32553ce31f58acb414869b0b7a8.tar.gz gcc-ca361dec8f52c32553ce31f58acb414869b0b7a8.tar.bz2 |
gimplify.c (gimplify_return_expr): Gimplify the size expressions of a variable-sized RESULT_DECL.
* gimplify.c (gimplify_return_expr): Gimplify the size expressions of
a variable-sized RESULT_DECL.
From-SVN: r159074
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/lto2.adb | 28 |
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ebba773..9cee690 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-05-05 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/lto2.adb: New test. + 2010-05-05 Jason Merrill <jason@redhat.com> PR c++/43787 diff --git a/gcc/testsuite/gnat.dg/lto2.adb b/gcc/testsuite/gnat.dg/lto2.adb new file mode 100644 index 0000000..8738e23 --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto2.adb @@ -0,0 +1,28 @@ +-- { dg-do compile } +-- { dg-options "-flto" } + +procedure Lto2 (Nbytes : Natural) is + + type Message_T (Length : Natural) is record + case Length is + when 0 => null; + when others => Id : Natural; + end case; + end record; + + type Local_Message_T is new Message_T (Nbytes); + + function One_message return Local_Message_T is + M : Local_Message_T; + begin + if M.Length > 0 then + M.Id := 1; + end if; + return M; + end; + + procedure Process (X : Local_Message_T) is begin null; end; + +begin + Process (One_Message); +end; |