global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / asm_dvinit.hhas
blob1fbb530163985f3a07f12151cb321fefa58ea536
2 # Try out dv initializers in the assembler
5 .main {
6   String "beginning...\n"
7   Print
8   PopC
10   FPushFuncD 0 "main"
11   FCall <> 0 1 "" - "" ""
12   RetC
15 .function foo($x, $y = y_init) {
16   entry:
17           CGetL $x
18           CGetL $y
19           Concat
20           Print
21           RetC
23   y_init: String " default Y value\n"
24           SetL $y
25           PopC
26           Jmp entry
29 .function multiple($x = x_init,
30                    $y = y_init,
31                    $z = z_init) {
32   entry:  String "x = "
33           CGetL $x
34           Concat
35           Print
36           PopC
38           String "y = "
39           CGetL $y
40           Concat
41           Print
42           PopC
44           String "z = "
45           CGetL $z
46           Concat
47           Print
48           PopC
50           True
51           RetC
53   x_init: String "defaultx\n"
54           SetL $x
55           PopC
56   y_init: String "defaulty\n"
57           SetL $y
58           PopC
59   z_init: String "defaultz\n"
60           SetL $z
61           PopC
62           Jmp entry
65 .function main() {
66   FPushFuncD 1 "foo"
67   String "sup: "
68   FCall <> 1 1 "" - "" ""
69   PopC
71   FPushFuncD 2 "foo"
72   String "sup: "
73   String " non-default y value\n"
74   FCall <> 2 1 "" - "" ""
75   PopC
77   FPushFuncD 0 "multiple"
78   FCall <> 0 1 "" - "" ""
79   PopC
80   FPushFuncD 1 "multiple"
81   String "nondef\n"
82   FCall <> 1 1 "" - "" ""
83   PopC
84   FPushFuncD 2 "multiple"
85   String "nondef1\n"
86   String "nondef2\n"
87   FCall <> 2 1 "" - "" ""
88   PopC
90   String "done\n"
91   Print
92   RetC