Remove FPass[CV]Nop opcodes
[hiphop-php.git] / hphp / test / quick / asm_prop_init.hhas
blob6abc44d4789ac3ce1a955f29470e26c66a71bebf
2 # Some tests of property/constant initializers.
5 .main {
6   FPushFuncD 0 "init_test"
7   FCall 0
8   PopR
10   FPushFuncD 0 "uninit_test"
11   FCall 0
12   PopR
14   Int 1
15   RetC
18 .class Init {
19   .default_ctor;
20   .const BAR = """s:4:"1242";""";
21   .property [static public] foo = """s:11:"static prop";""";
22   .property [public] nonstat = """s:25:"this is a normal property";""";
25 .class Uninit {
26   .default_ctor;
27   .const BAR = uninit;
28   .property [static public] foo = uninit;
29   .property [public] nonstat = uninit;
31   .method [public] 86cinit($which) {
32     CGetL $which
33     String "BAR"
34     Same
35     JmpZ wtf
37     String "default BAR value"
38     RetC
40   wtf:
41     String "unknown property"
42     Fatal Runtime
43   }
45   .method [public] 86sinit() {
46     String "default ::foo value"
47     InitProp "foo" Static
49     Null
50     RetC
51   }
53   .method [public] 86pinit() {
54     CheckProp "nonstat"
55     JmpNZ isset
56     String "code-created prop value"
57     InitProp "nonstat" NonStatic
59   isset:
60     Null
61     RetC
62   }
65 .function do_test($who) {
66   .numclsrefslots 1;
68   ClsRefGetL $who 0
69   ClsCns "BAR" 0
70   String "\n"
71   Concat
72   Print
73   PopC
75   String "foo"
76   ClsRefGetL $who 0
77   CGetS 0
78   String "\n"
79   Concat
80   Print
81   PopC
83   ClsRefGetL $who 0
84   FPushCtor 0 0
85   FCall 0
86   PopR
87   SetL $obj
88   PopC
90   String "nonstat"
91   BaseL $obj Warn
92   QueryM 1 CGet PC:0
93   String "\n"
94   Concat
95   Print
96   PopC
98   Null
99   RetC
102 .function init_test {
103   FPushFuncD 1 "do_test"
104     String "Init"
105   FCall 1
106   UnboxR
107   RetC
110 .function uninit_test {
111   FPushFuncD 1 "do_test"
112     String "Uninit"
113   FCall 1
114   UnboxR
115   RetC