Migarting the mbas' negative test cases from the old folder to here.
[mono.git] / mcs / mbas / Test / errors / SyncLockC1.vb
1 REM LineNo: 15\r
2 REM ExpectedError: BC30755\r
3 REM ErrorMessage: 'Goto label' is not valid because 'label' is inside a 'SyncLock' \r
4 REM               statement that does not contain this statement.\r
5 \r
6 Imports System\r
7 \r
8 Module SyncLockC1\r
9     Class C\r
10 \r
11         Private Shared count = 0\r
12 \r
13         Sub IncrementCount()\r
14             Console.WriteLine(count)\r
15             GoTo label\r
16             SyncLock GetType(C)\r
17 label:\r
18                 count += 1\r
19                 Console.WriteLine(count)\r
20             End SyncLock\r
21         End Sub\r
22 \r
23 \r
24     End Class\r
25 \r
26     Sub Main()\r
27         Dim c As New C()\r
28         c.IncrementCount()\r
29     End Sub\r
30 \r
31 End Module