summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/thin_pointer2_pkg.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gnat.dg/thin_pointer2_pkg.adb')
-rw-r--r--gcc/testsuite/gnat.dg/thin_pointer2_pkg.adb18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/thin_pointer2_pkg.adb b/gcc/testsuite/gnat.dg/thin_pointer2_pkg.adb
new file mode 100644
index 000000000..22500773c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/thin_pointer2_pkg.adb
@@ -0,0 +1,18 @@
+package body Thin_Pointer2_Pkg is
+
+ type SB is access constant String;
+
+ function Inner (S : SB) return Character is
+ begin
+ if S /= null and then S'Length > 0 then
+ return S (S'First);
+ end if;
+ return '*';
+ end;
+
+ function F return Character is
+ begin
+ return Inner (SB (S));
+ end;
+
+end Thin_Pointer2_Pkg;