Rune - Fix array passing, optimize constant array indices
[rune.git] / tests / block.d
1 #!/usr/local/bin/rune -x
2 #
3
4 import "sys";
5 import <stdio>;
6
7 int
8 main(int ac, char **av)
9 {
10         int i;
11
12         stdio.stdout->format("should show BC,DEFGJDK: ");
13         {
14                 BLOCK1 {
15                         break BLOCK1;
16                         stdio.stdout->format("A");
17                 }
18                 stdio.stdout->format("B");
19         }
20         stdio.stdout->format("C,");
21
22         i = 0;
23         BLOCK0 {
24                 stdio.stdout->format("D");
25                 if (++i == 2)
26                         break block;
27                 stdio.stdout->format("E");
28                 BLOCK1 {
29                         stdio.stdout->format("F");
30                         BLOCK2 {
31                                 stdio.stdout->format("G");
32                                 if (i == 1)
33                                         break BLOCK1;
34                                 stdio.stdout->format("H");
35                         }
36                         stdio.stdout->format("I");
37                 }
38                 stdio.stdout->format("J");
39                 continue BLOCK0;
40         }
41         stdio.stdout->format("K");
42         stdio.stdout->format("\n");
43         if (--ac > 0)
44                 continue procedure;
45
46         return(0);
47 }