Skip to content

Commit 048fe68

Browse files
committed
test: add test for yul function definitions
1 parent 4e938a4 commit 048fe68

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

test/corpus/yul.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,60 @@ contract Example {
179179
(yul_evm_builtin))
180180
(yul_decimal_number)))))))))
181181

182+
================================================================================
183+
Yul Function Definition
184+
================================================================================
185+
186+
contract Example {
187+
function foo() public {
188+
assembly {
189+
function allocate(length) -> pos {
190+
pos := mload(0x40)
191+
mstore(0x40, add(pos, length))
192+
}
193+
}
194+
}
195+
}
196+
197+
--------------------------------------------------------------------------------
198+
199+
(source_file
200+
(contract_declaration
201+
(identifier)
202+
(contract_body
203+
(function_definition
204+
(identifier)
205+
(visibility)
206+
(function_body
207+
(statement
208+
(assembly_statement
209+
(yul_function_definition
210+
(yul_identifier
211+
(identifier))
212+
(yul_identifier
213+
(identifier))
214+
(yul_identifier
215+
(identifier))
216+
(yul_block
217+
(yul_assignment
218+
(yul_path
219+
(yul_identifier
220+
(identifier)))
221+
(yul_function_call
222+
(yul_evm_builtin)
223+
(yul_hex_number)))
224+
(yul_function_call
225+
(yul_evm_builtin)
226+
(yul_hex_number)
227+
(yul_function_call
228+
(yul_evm_builtin)
229+
(yul_path
230+
(yul_identifier
231+
(identifier)))
232+
(yul_path
233+
(yul_identifier
234+
(identifier))))))))))))))
235+
182236
================================================================================
183237
Assembly Hex String Literals
184238
================================================================================

0 commit comments

Comments
 (0)