gcc/testsuite/gnat.dg/spark1.adb
raw| 1 | -- { dg-do compile } |
| 2 | |
| 3 | package body Spark1 is |
| 4 | |
| 5 | task body Worker is |
| 6 | |
| 7 | procedure Update with |
| 8 | Global => (In_Out => Mailbox) -- { dg-error "global item \"Mailbox\" cannot have mode In_Out or Output|item already appears as input of task \"Worker\"" } |
| 9 | is |
| 10 | Tmp : Integer := Mailbox; |
| 11 | begin |
| 12 | Mailbox := Tmp + 1; |
| 13 | end Update; |
| 14 | |
| 15 | X : Integer := Mailbox; |
| 16 | begin |
| 17 | loop |
| 18 | Update; |
| 19 | end loop; |
| 20 | end; |
| 21 | |
| 22 | end; |