global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / asm_switch.hhas
blobee0294c5dd88c8dd11bf578e076c51c8191d5681
2 # Switch statement
5 .main {
6   FPushFuncD 0 "main"
7   FCall <> 0 1 "" - "" ""
8   PopC
9   Int 1
10   RetC
13 # array(0,1,2,3,4)
14 .adata my_array = """a:5:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;}""";
16 .function main() {
17          .numiters 1;
19          Array @my_array
20          SetL $arr
21          PopC
23          # Loop over array and jump to each label.
24          CGetL $arr
25          IterInit 0 endfor $foo
26 loop:    CGetL $foo
27          Switch Unbounded 0 <label_0 label_1 label_2 label_3 label_4>
29 label_0: String "label_0\n"
30          Jmp printer
31 label_1: String "label_1\n"
32          Jmp printer
33 label_2: String "label_2\n"
34          Jmp printer
35 label_3: String "label_3\n"
36          Jmp printer
37 label_4: String "label_4\n"
39 printer: Print
40          PopC
41          IterNext 0 loop $foo
43 endfor:  Int 1
44          RetC