diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gnat.dg/sizetype2.adb')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gnat.dg/sizetype2.adb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/sizetype2.adb b/gcc-4.9/gcc/testsuite/gnat.dg/sizetype2.adb new file mode 100644 index 000000000..4593936c8 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gnat.dg/sizetype2.adb @@ -0,0 +1,27 @@ +-- { dg-do run } + +procedure Sizetype2 is + + function Ident_Int (X : Integer) return Integer is + begin + return X; + end; + + type A is array (Integer range <>) of Boolean; + subtype T1 is A (Ident_Int (- 6) .. Ident_Int (Integer'Last - 4)); + subtype T2 is A (- 6 .. Ident_Int (Integer'Last - 4)); + subtype T3 is A (Ident_Int (- 6) .. Integer'Last - 4); + +begin + if T1'Size /= 17179869200 then + raise Program_Error; + end if; + + if T2'Size /= 17179869200 then + raise Program_Error; + end if; + + if T3'Size /= 17179869200 then + raise Program_Error; + end if; +end; |