* gnat.dg/sync1.ad[sb]: New test.
authorArnaud Charlet <charlet@adacore.com>
Tue, 27 May 2008 09:11:45 +0000 (09:11 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 27 May 2008 09:11:45 +0000 (11:11 +0200)
From-SVN: r135989

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

index 79bbe74c750be3edd318774e010b30993f868cf2..6bb5bc41fb54208d7aee2c7c731abd41c93467c9 100644 (file)
@@ -1,3 +1,7 @@
+2008-05-27  Arnaud Charlet  <charlet@adacore.com>
+
+       * gnat.dg/sync1.ad[sb]: New test.
+
 2008-05-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * gcc.c-torture/compile/pr11832.c: XFAIL on (x86 && ilp32 && pic).
diff --git a/gcc/testsuite/gnat.dg/sync1.adb b/gcc/testsuite/gnat.dg/sync1.adb
new file mode 100644 (file)
index 0000000..08be639
--- /dev/null
@@ -0,0 +1,15 @@
+--  { dg-do compile }
+package body sync1 is
+   protected body Chopstick is
+
+     entry Pick_Up when not Busy is
+     begin
+        Busy := True;
+     end Pick_Up;
+
+     procedure Put_Down is
+     begin
+        Busy := False;
+     end Put_Down;
+   end Chopstick;
+end sync1;
diff --git a/gcc/testsuite/gnat.dg/sync1.ads b/gcc/testsuite/gnat.dg/sync1.ads
new file mode 100644 (file)
index 0000000..81c2f4a
--- /dev/null
@@ -0,0 +1,12 @@
+package sync1 is
+   type Chopstick_Type is synchronized interface;
+   
+   type Chopstick is new Chopstick_Type with private;
+private
+   protected type Chopstick is new Chopstick_Type with
+      entry Pick_Up;
+      procedure Put_Down;
+   private
+      Busy : Boolean := False;
+   end Chopstick;
+end sync1;