diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gnat.dg/specs/discr_record_constant.ads')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gnat.dg/specs/discr_record_constant.ads | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/specs/discr_record_constant.ads b/gcc-4.9/gcc/testsuite/gnat.dg/specs/discr_record_constant.ads new file mode 100644 index 000000000..f43b13869 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gnat.dg/specs/discr_record_constant.ads @@ -0,0 +1,22 @@ +-- { dg-do compile } + +pragma Restrictions (No_Implicit_Heap_Allocations); + +package Discr_Record_Constant is + + type T (Big : Boolean := False) is record + case Big is + when True => + Content : Integer; + when False => + null; + end case; + end record; + + D : constant T := (True, 0); + + Var : T := D; -- OK, maximum size + Con : constant T := D; -- Violation of restriction + Ter : constant T := Con; -- Violation of restriction + +end Discr_Record_Constant; |