]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gnat.dg/sync_iface_test.ad[s,b]: New test.
authorArnaud Charlet <charlet@adacore.com>
Thu, 31 Jul 2008 13:45:32 +0000 (13:45 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 31 Jul 2008 13:45:32 +0000 (15:45 +0200)
From-SVN: r138410

gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/sync_iface_test.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/sync_iface_test.ads [new file with mode: 0644]

index f819f289f28d435df98265008bc556c1c3896f2d..5cc546704e849f2f3315620d1987a4eb6982d940 100644 (file)
@@ -1,5 +1,7 @@
 2008-07-31  Arnaud Charlet  <charlet@adacore.com>
 
+       * gnat.dg/sync_iface_test.ad[s,b]: New test.
+
        * gnat.dg/specs/sync_iface_test.ads: New test.
 
 2008-07-31  H.J. Lu  <hongjiu.lu@intel.com>
diff --git a/gcc/testsuite/gnat.dg/sync_iface_test.adb b/gcc/testsuite/gnat.dg/sync_iface_test.adb
new file mode 100644 (file)
index 0000000..f431adf
--- /dev/null
@@ -0,0 +1,19 @@
+--  { dg-do compile }
+package body Sync_Iface_Test is
+   protected body Buffer is
+      procedure Dummy is begin null; end;
+   end;
+
+   function First (Obj : Buffer) return Natural is
+   begin
+     return 0;
+   end;
+
+   procedure Do_Test (Dummy : Natural; Item : Buffer)
+   is
+      Position1 : Natural := First (Item);
+      Position2 : Natural := Item.First;   --  Problem here
+   begin
+      null;
+   end;
+end;
diff --git a/gcc/testsuite/gnat.dg/sync_iface_test.ads b/gcc/testsuite/gnat.dg/sync_iface_test.ads
new file mode 100644 (file)
index 0000000..c172d7f
--- /dev/null
@@ -0,0 +1,11 @@
+package Sync_Iface_Test is
+   type Iface is limited interface;
+   function First (Obj : Iface) return Natural is abstract;
+
+   protected type Buffer is new Iface with
+      procedure Dummy;
+   end;
+   overriding function First (Obj : Buffer) return Natural;
+
+   procedure Do_Test (Dummy : Natural; Item  : Buffer);
+end;