diff options
Diffstat (limited to 'gcc/testsuite/gnat.dg/pack5.adb')
-rw-r--r-- | gcc/testsuite/gnat.dg/pack5.adb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/pack5.adb b/gcc/testsuite/gnat.dg/pack5.adb new file mode 100644 index 00000000000..12bea11a311 --- /dev/null +++ b/gcc/testsuite/gnat.dg/pack5.adb @@ -0,0 +1,32 @@ +-- { dg-do compile } + +procedure Pack5 is + + type Kind is (v1, v2, v3); + + type Error (k : Kind := Kind'First) is record + case k is + when v1 => + null; + when v2 => + null; + when Others => + B : Boolean; + end case; + end record; + pragma Pack (Error); + for Error'Size use 16; + + No_Error: constant Error := (k => v2); + + type R (B : Boolean) is record + E : Error; + end record; + pragma Pack(R); + type Ptr is access R; + + C : Ptr := new R (True); + +begin + C.E := No_Error; +end; |