summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-18 13:52:46 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-18 13:52:46 +0000
commite7ffa1e68699c0bf8a68b11e0f6e44526e46eb4f (patch)
tree40162bebea953063b468308fa9475a3a6732b079 /gcc/testsuite/gnat.dg
parent27546795d9934e40dbc7888739786485ba03f287 (diff)
downloadgcc-e7ffa1e68699c0bf8a68b11e0f6e44526e46eb4f.tar.gz
* calls.c (mem_overlaps_already_clobbered_arg_p): Return true
for arg pointer based indexed addressing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122095 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r--gcc/testsuite/gnat.dg/tail_call.adb9
-rw-r--r--gcc/testsuite/gnat.dg/tail_call_p.adb35
-rw-r--r--gcc/testsuite/gnat.dg/tail_call_p.ads13
3 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/tail_call.adb b/gcc/testsuite/gnat.dg/tail_call.adb
new file mode 100644
index 00000000000..4f109adffc5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/tail_call.adb
@@ -0,0 +1,9 @@
+-- { dg-do run }
+-- { dg-options "-O2 -fno-unit-at-a-time" }
+
+with Tail_Call_P; use Tail_Call_P;
+
+procedure Tail_Call is
+begin
+ Insert (My_Array, 0, 0);
+end;
diff --git a/gcc/testsuite/gnat.dg/tail_call_p.adb b/gcc/testsuite/gnat.dg/tail_call_p.adb
new file mode 100644
index 00000000000..56add5f6b75
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/tail_call_p.adb
@@ -0,0 +1,35 @@
+package body Tail_Call_P is
+
+ function Start_Side (Element : T) return Index is
+ begin
+ if Element = 1 then
+ raise Program_Error;
+ end if;
+ if Element = 0 then
+ return Second;
+ else
+ return First;
+ end if;
+ end;
+
+ function Segment (Element : T) return T is
+ begin
+ if Element /= 0 then
+ raise Program_Error;
+ end if;
+ return 1;
+ end;
+
+ procedure Really_Insert (Into : T; Element : T; Value : T) is
+ begin
+ if Into /= 0 then
+ raise Program_Error;
+ end if;
+ end;
+
+ procedure Insert (Into : A; Element : T; Value : T) is
+ begin
+ Really_Insert (Into (Start_Side (Element)), Segment (Element), Value);
+ end Insert;
+
+end Tail_Call_P;
diff --git a/gcc/testsuite/gnat.dg/tail_call_p.ads b/gcc/testsuite/gnat.dg/tail_call_p.ads
new file mode 100644
index 00000000000..1665bc30c55
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/tail_call_p.ads
@@ -0,0 +1,13 @@
+package Tail_Call_P is
+
+ type T is new Natural;
+
+ type Index is (First, Second);
+
+ type A is array (Index) of T;
+
+ My_Array : A := (0, 0);
+
+ procedure Insert (Into : A; Element : T; Value : T);
+
+end Tail_Call_P;