diff options
Diffstat (limited to 'gcc/testsuite/gnat.dg/array10.adb')
-rw-r--r-- | gcc/testsuite/gnat.dg/array10.adb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/array10.adb b/gcc/testsuite/gnat.dg/array10.adb new file mode 100644 index 000000000..37ee8ffb4 --- /dev/null +++ b/gcc/testsuite/gnat.dg/array10.adb @@ -0,0 +1,25 @@ +-- { dg-do run } +-- Verify that an array of non-aliased zero-sized element is zero-sized + +procedure Array10 is + + type Rec is null record; + + type Arr1 is array (1..8) of Rec; + type Arr2 is array (Long_Integer) of Rec; + + R : Rec; + A1 : Arr1; + A2 : Arr2; + +begin + if Rec'Size /= 0 then + raise Program_Error; + end if; + if Arr1'Size /= 0 then + raise Program_Error; + end if; + if Arr2'Size /= 0 then + raise Program_Error; + end if; +end; |