Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement "stateless" modules #3663

Merged
merged 140 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from 130 commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
8a56425
feat: implement pure libraries
charles-cooper Nov 7, 2023
0625bbb
fix topsort
charles-cooper Nov 7, 2023
684a83d
fix a typo
charles-cooper Nov 7, 2023
3ef38c4
introduce ModuleInfo
charles-cooper Nov 8, 2023
e3edb7e
fix a circular import
charles-cooper Nov 8, 2023
eca6379
change a docstring
charles-cooper Nov 8, 2023
bb37ee2
`at()` to convert ModuleT to InterfaceT
charles-cooper Nov 8, 2023
2038549
fix a bug
charles-cooper Nov 8, 2023
3f38b43
feat: module.at(<address>)
charles-cooper Nov 8, 2023
2caaf9d
Merge branch 'master' into feat/libraries
charles-cooper Nov 9, 2023
aba6558
fix some bugs
charles-cooper Nov 9, 2023
febaa96
fix some tests
charles-cooper Nov 9, 2023
19404e9
detect import cycles
charles-cooper Nov 10, 2023
21a04c3
remove `.name` from module ast
charles-cooper Nov 11, 2023
52943e1
abstract out a common exception rewriting pattern
charles-cooper Nov 11, 2023
4a8cc12
remove a note
charles-cooper Nov 17, 2023
0a786f7
rollback `module.at()` method
charles-cooper Nov 20, 2023
b61176e
fix some tests
charles-cooper Nov 21, 2023
6c7f795
refactor builtin interfaces to `.vyi` files
charles-cooper Nov 23, 2023
c923714
wip: .vyi files
charles-cooper Nov 23, 2023
924980a
implement ellipsis in interfaces
charles-cooper Nov 28, 2023
e9da1f2
whitespace
charles-cooper Dec 6, 2023
4a3cfd2
fix getter generation in ABI
charles-cooper Dec 6, 2023
6a7e603
rename "type" metadata to "func_type" on function declaration objects
charles-cooper Dec 7, 2023
9171934
Merge branch 'master' into feat/libraries
charles-cooper Dec 7, 2023
6c81142
fix some interface tests
charles-cooper Dec 7, 2023
e7e37b8
fix some more tests
charles-cooper Dec 7, 2023
1b7162b
revert change enabling `Bytes[...]`
charles-cooper Dec 10, 2023
26fb9e0
fix old usage of reachable_internal_functions
charles-cooper Dec 10, 2023
1e2a235
fix another type error
charles-cooper Dec 10, 2023
c58bfa0
fix sqrt
charles-cooper Dec 10, 2023
467720b
ensure _ir_info is populated whether or not functions are reachable
charles-cooper Dec 10, 2023
c6eba5e
fix a bad test
charles-cooper Dec 10, 2023
9c537cc
fix some interfaces in tests
charles-cooper Dec 10, 2023
25563f6
fix a bad type dispatch
charles-cooper Dec 10, 2023
9838ad6
fix call to validate_semantics
charles-cooper Dec 10, 2023
90731a2
fix InterfaceT.from_Module
charles-cooper Dec 10, 2023
a86cc02
set search path correctly in nested imports
charles-cooper Dec 10, 2023
82cb5bd
fix some tests
charles-cooper Dec 10, 2023
0a3d618
fix another small test
charles-cooper Dec 10, 2023
c6d8892
fix lint
charles-cooper Dec 10, 2023
88843e9
fix some calls to validate_semantics
charles-cooper Dec 10, 2023
2f739d0
fix mypy
charles-cooper Dec 10, 2023
0ce2a58
add a todo
charles-cooper Dec 10, 2023
ba50a83
fix an old key
charles-cooper Dec 10, 2023
dc506a8
move test_interfaces.py to codegen/ tests
charles-cooper Dec 10, 2023
ecb3841
remove dead code
charles-cooper Dec 10, 2023
5bb66b5
remove dead package pytest-rerunfailures
charles-cooper Dec 10, 2023
3d5e3b1
add a note
charles-cooper Dec 10, 2023
ad78f07
remove dead function
charles-cooper Dec 10, 2023
7ebd09c
refactor: move `parse_*` functions, remove vyper.ast.annotation
charles-cooper Dec 10, 2023
a0ff2b8
refactor: CompilerInput.from_string
charles-cooper Dec 10, 2023
84a33db
implement eq/hash on ModuleT
charles-cooper Dec 10, 2023
84f2298
remove dead comment
charles-cooper Dec 10, 2023
21abfb6
fix some bad imports
charles-cooper Dec 10, 2023
2a9db07
fix lint
charles-cooper Dec 10, 2023
0b78923
remove `remove_unused_statements()`
charles-cooper Dec 10, 2023
269a9cf
refactor cycle detection
charles-cooper Dec 10, 2023
b0ac484
remove expand_annotated_ast
charles-cooper Dec 10, 2023
a95000d
fix analysis on imported modules
charles-cooper Dec 10, 2023
50f388e
small fixes
charles-cooper Dec 10, 2023
9b5bff2
factor out parse_and_fold_ast
charles-cooper Dec 10, 2023
a43beff
fix mypy
charles-cooper Dec 10, 2023
487e29b
fix global namespace
charles-cooper Dec 10, 2023
abbe697
fix generate_inline_function
charles-cooper Dec 10, 2023
9509dc9
Merge branch 'master' into feat/libraries
charles-cooper Dec 10, 2023
fa4a30f
fix tokenization of comments in lark grammar
charles-cooper Dec 10, 2023
292d085
rename storage layout test directory
charles-cooper Dec 10, 2023
5b8847e
relax import restrictions
charles-cooper Dec 10, 2023
b26c00a
improve ModuleNotFound error
charles-cooper Dec 10, 2023
e4693a0
fix name/alias resolution
charles-cooper Dec 10, 2023
93401f3
add library test to test_compile_files
charles-cooper Dec 10, 2023
4295dcc
missing import
charles-cooper Dec 10, 2023
373abd6
update interfaces output
charles-cooper Dec 10, 2023
663dc1e
change function labels in IR
charles-cooper Dec 10, 2023
7ac2f62
add a note
charles-cooper Dec 10, 2023
d297418
fix: use codegen.core._freshname to generate self call labels
charles-cooper Dec 10, 2023
34b45c8
make compilation targets adhere to outputSelection
charles-cooper Dec 10, 2023
5c0d3a7
use orderedset for json inputs
charles-cooper Dec 10, 2023
9902baf
add library to json tests
charles-cooper Dec 10, 2023
9bdf12c
remove dead code
charles-cooper Dec 10, 2023
64f6840
fix lint
charles-cooper Dec 10, 2023
42dfd2b
fix lint
charles-cooper Dec 10, 2023
ba11cff
fix a signature
charles-cooper Dec 11, 2023
c7ea5c9
disambiguate types with same name across different modules
charles-cooper Dec 11, 2023
418eb97
fix some small bugs
charles-cooper Dec 11, 2023
e64b52c
update some hardcoded asm
charles-cooper Dec 11, 2023
f5ff470
fix unassigned variable
charles-cooper Dec 11, 2023
c86d267
fix lint
charles-cooper Dec 11, 2023
0ac1043
make module argument optional for structs
charles-cooper Dec 11, 2023
5ebb252
fix some updates to json cli api
charles-cooper Dec 11, 2023
d880e58
add libraries test file
charles-cooper Dec 11, 2023
34052b0
roll back changes require threading around the module ast
charles-cooper Dec 11, 2023
15ad3cc
fix lint
charles-cooper Dec 11, 2023
91642f0
add InputBundle._normalize_path
charles-cooper Dec 11, 2023
4db4928
rename ModuleInfo.module to ModuleInfo.module_t
charles-cooper Dec 11, 2023
028d96c
fix source_id threading
charles-cooper Dec 11, 2023
8d7a5dd
enrich CompilerInput
charles-cooper Dec 11, 2023
0a37e1c
change compile_code api from contract_name= to contract_path=
charles-cooper Dec 11, 2023
8b477eb
introduce source_id= back into compile_code
charles-cooper Dec 11, 2023
64a5379
add compile_from_file_input
charles-cooper Dec 11, 2023
39575e8
fix bunch of bugs in path resolution of imports
charles-cooper Dec 11, 2023
9ef6ea7
fix compile for regular files
charles-cooper Dec 11, 2023
b64035d
add support for attribute access on modules/interfaces: structs and e…
charles-cooper Dec 11, 2023
58940a0
allow string input to CompilerData
charles-cooper Dec 11, 2023
f34d7d1
remove ability to `implements: ModuleT`
charles-cooper Dec 11, 2023
be07dfd
fix small type bug
charles-cooper Dec 11, 2023
88250cc
fix a bad function call
charles-cooper Dec 11, 2023
183aada
fix a bug in _normalize_path
charles-cooper Dec 11, 2023
0a84ef2
fix another bad function call
charles-cooper Dec 11, 2023
3d2c95f
handle self calls in statements
charles-cooper Dec 12, 2023
2e32ba8
fix transitive imports
charles-cooper Dec 12, 2023
5476076
trap calls to external functions in libraries
charles-cooper Dec 12, 2023
bfde0cb
add more tests for libraries
charles-cooper Dec 12, 2023
7aa80e3
new scheme for IR identifiers -- use function ID
charles-cooper Dec 12, 2023
91c16e5
update selector table stability tests
charles-cooper Dec 12, 2023
5a9eea7
fix asm tests
charles-cooper Dec 12, 2023
59922f3
fix lint, mypy
charles-cooper Dec 12, 2023
a734b09
hygiene: raise proper exception
charles-cooper Dec 12, 2023
dd1ea14
test imported structs
charles-cooper Dec 12, 2023
c7584bd
add a couple more tests for libraries
charles-cooper Dec 12, 2023
76f3abb
fix a regression
charles-cooper Dec 12, 2023
48a76b4
handle some errors better
charles-cooper Dec 12, 2023
1fafca6
fix mypy
charles-cooper Dec 12, 2023
a441e2f
remove a dead variable
charles-cooper Dec 12, 2023
6e1a05e
update a test name
charles-cooper Dec 12, 2023
94ff82b
change an argument name
charles-cooper Dec 12, 2023
6edcbdd
reject duplicate imports
charles-cooper Dec 12, 2023
d9b9f3b
fix some tests
charles-cooper Dec 13, 2023
0b64abe
rename test file
charles-cooper Dec 13, 2023
255a93a
refactor: move InterfaceT into vyper/semantics/types/module.py
charles-cooper Dec 13, 2023
9ec83d4
address review comments
charles-cooper Dec 13, 2023
74c630e
remove unneeded F401
charles-cooper Dec 13, 2023
132fde0
add library code eliminator test
charles-cooper Dec 14, 2023
64bc3a5
make nested libraries work
charles-cooper Dec 15, 2023
dcb55b4
refactor a side effect
charles-cooper Dec 15, 2023
d26f401
fix missing import
charles-cooper Dec 15, 2023
bea05ca
add test for imported slice
charles-cooper Dec 15, 2023
7066688
remove stray print
charles-cooper Dec 16, 2023
b0c6684
add a note on Module.__eq__
charles-cooper Dec 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"pytest-instafail>=0.4,<1.0",
"pytest-xdist>=2.5,<3.0",
"pytest-split>=0.7.0,<1.0",
"pytest-rerunfailures>=10.2,<11",
"eth-tester[py-evm]>=0.9.0b1,<0.10",
"py-evm>=0.7.0a1,<0.8",
"web3==6.0.0",
Expand Down
10 changes: 9 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from vyper import compiler
from vyper.ast.grammar import parse_vyper_source
from vyper.codegen.ir_node import IRnode
from vyper.compiler.input_bundle import FilesystemInputBundle
from vyper.compiler.input_bundle import FilesystemInputBundle, InputBundle
from vyper.compiler.settings import OptimizationLevel, Settings, _set_debug_mode
from vyper.ir import compile_ir, optimizer

Expand Down Expand Up @@ -103,6 +103,12 @@ def fn(sources_dict):
return fn


# for tests which just need an input bundle, doesn't matter what it is
@pytest.fixture
def dummy_input_bundle():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could just call this input_bundle, given it can be easily overridden in other tests.
Alternatively, empty_input_bundle might be clearer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm interesting. well, InputBundle() is actually not fully functioning since it's a base class, it will raise exceptions if you try to use it: https://github.com/charles-cooper/vyper/blob/74c630ece2723cf24418acf9c635418ab2c2a461/vyper/compiler/input_bundle.py#L73-L77

so i wanted to use it for tests which need an object of type InputBundle, but can never actually call into it.

return InputBundle([])


# TODO: remove me, this is just string.encode("utf-8").ljust()
# only used in test_logging.py.
@pytest.fixture
Expand Down Expand Up @@ -255,9 +261,11 @@ def ir_compiler(ir, *args, **kwargs):
ir = IRnode.from_list(ir)
if optimize != OptimizationLevel.NONE:
ir = optimizer.optimize(ir)

bytecode, _ = compile_ir.assembly_to_evm(
compile_ir.compile_to_assembly(ir, optimize=optimize)
)

abi = kwargs.get("abi") or []
c = w3.eth.contract(abi=abi, bytecode=bytecode)
deploy_transaction = c.constructor()
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/codegen/test_call_graph_stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def foo():

# check the .called_functions data structure on foo() directly
foo = t.vyper_module_folded.get_children(vy_ast.FunctionDef, filters={"name": "foo"})[0]
foo_t = foo._metadata["type"]
foo_t = foo._metadata["func_type"]
assert [f.name for f in foo_t.called_functions] == func_names

# now for sanity, ensure the order that the function definitions appear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from vyper.compiler import compile_code
from vyper.exceptions import (
ArgumentException,
DuplicateImport,
InterfaceViolation,
NamespaceCollision,
StructureException,
)


Expand All @@ -31,7 +31,7 @@ def allowance(_owner: address, _spender: address) -> (uint256, uint256):

out = compile_code(code, output_formats=["interface"])
out = out["interface"]
code_pass = "\n".join(code.split("\n")[:-2] + [" pass"]) # replace with a pass statement.
code_pass = "\n".join(code.split("\n")[:-2] + [" ..."]) # replace with a pass statement.

assert code_pass.strip() == out.strip()

Expand Down Expand Up @@ -60,7 +60,7 @@ def allowance(_owner: address, _spender: address) -> (uint256, uint256): view
def test(_owner: address): nonpayable
"""

out = compile_code(code, contract_name="One.vy", output_formats=["external_interface"])[
out = compile_code(code, contract_path="One.vy", output_formats=["external_interface"])[
"external_interface"
]

Expand All @@ -85,14 +85,14 @@ def test_external_interface_parsing(make_input_bundle, assert_compile_failed):
interface_code = """
@external
def foo() -> uint256:
pass
...

@external
def bar() -> uint256:
pass
...
"""

input_bundle = make_input_bundle({"a.vy": interface_code})
input_bundle = make_input_bundle({"a.vyi": interface_code})

code = """
import a as FooBarInterface
Expand Down Expand Up @@ -121,9 +121,8 @@ def foo() -> uint256:

"""

assert_compile_failed(
lambda: compile_code(not_implemented_code, input_bundle=input_bundle), InterfaceViolation
)
with pytest.raises(InterfaceViolation):
compile_code(not_implemented_code, input_bundle=input_bundle)


def test_missing_event(make_input_bundle, assert_compile_failed):
Expand All @@ -132,7 +131,7 @@ def test_missing_event(make_input_bundle, assert_compile_failed):
a: uint256
"""

input_bundle = make_input_bundle({"a.vy": interface_code})
input_bundle = make_input_bundle({"a.vyi": interface_code})

not_implemented_code = """
import a as FooBarInterface
Expand All @@ -156,7 +155,7 @@ def test_malformed_event(make_input_bundle, assert_compile_failed):
a: uint256
"""

input_bundle = make_input_bundle({"a.vy": interface_code})
input_bundle = make_input_bundle({"a.vyi": interface_code})

not_implemented_code = """
import a as FooBarInterface
Expand All @@ -183,7 +182,7 @@ def test_malformed_events_indexed(make_input_bundle, assert_compile_failed):
a: uint256
"""

input_bundle = make_input_bundle({"a.vy": interface_code})
input_bundle = make_input_bundle({"a.vyi": interface_code})

not_implemented_code = """
import a as FooBarInterface
Expand Down Expand Up @@ -211,7 +210,7 @@ def test_malformed_events_indexed2(make_input_bundle, assert_compile_failed):
a: indexed(uint256)
"""

input_bundle = make_input_bundle({"a.vy": interface_code})
input_bundle = make_input_bundle({"a.vyi": interface_code})

not_implemented_code = """
import a as FooBarInterface
Expand All @@ -234,13 +233,13 @@ def bar() -> uint256:

VALID_IMPORT_CODE = [
# import statement, import path without suffix
("import a as Foo", "a.vy"),
("import b.a as Foo", "b/a.vy"),
("import Foo as Foo", "Foo.vy"),
("from a import Foo", "a/Foo.vy"),
("from b.a import Foo", "b/a/Foo.vy"),
("from .a import Foo", "./a/Foo.vy"),
("from ..a import Foo", "../a/Foo.vy"),
("import a as Foo", "a.vyi"),
("import b.a as Foo", "b/a.vyi"),
("import Foo as Foo", "Foo.vyi"),
("from a import Foo", "a/Foo.vyi"),
("from b.a import Foo", "b/a/Foo.vyi"),
("from .a import Foo", "./a/Foo.vyi"),
("from ..a import Foo", "../a/Foo.vyi"),
]


Expand All @@ -252,61 +251,80 @@ def test_extract_file_interface_imports(code, filename, make_input_bundle):


BAD_IMPORT_CODE = [
("import a", StructureException), # must alias absolute imports
("import a as A\nimport a as A", NamespaceCollision),
("import a as A\nimport a as A", DuplicateImport),
("import a as A\nimport a as a", DuplicateImport),
("from . import a\nimport a as a", DuplicateImport),
("import a as a\nfrom . import a", DuplicateImport),
("from b import a\nfrom . import a", NamespaceCollision),
("from . import a\nimport a as a", NamespaceCollision),
("import a as a\nfrom . import a", NamespaceCollision),
("import a\nimport c as a", NamespaceCollision),
]


@pytest.mark.parametrize("code,exception_type", BAD_IMPORT_CODE)
def test_extract_file_interface_imports_raises(
code, exception_type, assert_compile_failed, make_input_bundle
):
input_bundle = make_input_bundle({"a.vy": "", "b/a.vy": ""}) # dummy
assert_compile_failed(lambda: compile_code(code, input_bundle=input_bundle), exception_type)
input_bundle = make_input_bundle({"a.vyi": "", "b/a.vyi": "", "c.vyi": ""})
print("ENTER", code)
with pytest.raises(exception_type):
compile_code(code, input_bundle=input_bundle)


def test_external_call_to_interface(w3, get_contract, make_input_bundle):
token_interface = """
@view
@external
def balanceOf(addr: address) -> uint256:
...

@external
def transfer(to: address, amount: uint256):
...
"""

token_code = """
import itoken as IToken

implements: IToken

balanceOf: public(HashMap[address, uint256])

@external
def transfer(to: address, _value: uint256):
self.balanceOf[to] += _value
def transfer(to: address, amount: uint256):
self.balanceOf[to] += amount
"""

input_bundle = make_input_bundle({"one.vy": token_code})
input_bundle = make_input_bundle({"token.vy": token_code, "itoken.vyi": token_interface})

code = """
import one as TokenCode
import itoken as IToken

interface EPI:
def test() -> uint256: view


token_address: TokenCode
token_address: IToken


@external
def __init__(_token_address: address):
self.token_address = TokenCode(_token_address)
self.token_address = IToken(_token_address)


@external
def test():
self.token_address.transfer(msg.sender, 1000)
"""

erc20 = get_contract(token_code)
test_c = get_contract(code, *[erc20.address], input_bundle=input_bundle)
token = get_contract(token_code, input_bundle=input_bundle)

test_c = get_contract(code, *[token.address], input_bundle=input_bundle)

sender = w3.eth.accounts[0]
assert erc20.balanceOf(sender) == 0
assert token.balanceOf(sender) == 0

test_c.test(transact={})
assert erc20.balanceOf(sender) == 1000
assert token.balanceOf(sender) == 1000


@pytest.mark.parametrize(
Expand All @@ -320,26 +338,36 @@ def test():
],
)
def test_external_call_to_interface_kwarg(get_contract, kwarg, typ, expected, make_input_bundle):
code_a = f"""
interface_code = f"""
@external
@view
def foo(_max: {typ} = {kwarg}) -> {typ}:
...
"""
code1 = f"""
import one as IContract

implements: IContract

@external
@view
def foo(_max: {typ} = {kwarg}) -> {typ}:
return _max
"""

input_bundle = make_input_bundle({"one.vy": code_a})
input_bundle = make_input_bundle({"one.vyi": interface_code})

code_b = f"""
import one as ContractA
code2 = f"""
import one as IContract

@external
@view
def bar(a_address: address) -> {typ}:
return ContractA(a_address).foo()
return IContract(a_address).foo()
"""

contract_a = get_contract(code_a)
contract_b = get_contract(code_b, *[contract_a.address], input_bundle=input_bundle)
contract_a = get_contract(code1, input_bundle=input_bundle)
contract_b = get_contract(code2, *[contract_a.address], input_bundle=input_bundle)

assert contract_b.bar(contract_a.address) == expected

Expand All @@ -349,8 +377,8 @@ def test_external_call_to_builtin_interface(w3, get_contract):
balanceOf: public(HashMap[address, uint256])

@external
def transfer(to: address, _value: uint256) -> bool:
self.balanceOf[to] += _value
def transfer(to: address, amount: uint256) -> bool:
self.balanceOf[to] += amount
return True
"""

Expand Down Expand Up @@ -510,14 +538,14 @@ def returns_Bytes3() -> Bytes[3]:
"""

should_not_compile = """
import BadJSONInterface as BadJSONInterface
import BadJSONInterface
@external
def foo(x: BadJSONInterface) -> Bytes[2]:
return slice(x.returns_Bytes3(), 0, 2)
"""

code = """
import BadJSONInterface as BadJSONInterface
import BadJSONInterface

foo: BadJSONInterface

Expand Down Expand Up @@ -578,10 +606,10 @@ def balanceOf(owner: address) -> uint256:
@external
@view
def balanceOf(owner: address) -> uint256:
pass
...
"""

input_bundle = make_input_bundle({"balanceof.vy": interface_code})
input_bundle = make_input_bundle({"balanceof.vyi": interface_code})

c = get_contract(code, input_bundle=input_bundle)

Expand All @@ -592,7 +620,7 @@ def test_simple_implements(make_input_bundle):
interface_code = """
@external
def foo() -> uint256:
pass
...
"""

code = """
Expand All @@ -605,7 +633,7 @@ def foo() -> uint256:
return 1
"""

input_bundle = make_input_bundle({"a.vy": interface_code})
input_bundle = make_input_bundle({"a.vyi": interface_code})

assert compile_code(code, input_bundle=input_bundle) is not None

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/codegen/test_selector_table_stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_dense_jumptable_stability():

# test that the selector table data is stable across different runs
# (tox should provide different PYTHONHASHSEEDs).
expected_asm = """{ DATA _sym_BUCKET_HEADERS b'\\x0bB' _sym_bucket_0 b'\\n' b'+\\x8d' _sym_bucket_1 b'\\x0c' b'\\x00\\x85' _sym_bucket_2 b'\\x08' } { DATA _sym_bucket_1 b'\\xd8\\xee\\xa1\\xe8' _sym_external_foo6___3639517672 b'\\x05' b'\\xd2\\x9e\\xe0\\xf9' _sym_external_foo0___3533627641 b'\\x05' b'\\x05\\xf1\\xe0_' _sym_external_foo2___99737695 b'\\x05' b'\\x91\\t\\xb4{' _sym_external_foo23___2433332347 b'\\x05' b'np3\\x7f' _sym_external_foo11___1852846975 b'\\x05' b'&\\xf5\\x96\\xf9' _sym_external_foo13___653629177 b'\\x05' b'\\x04ga\\xeb' _sym_external_foo14___73884139 b'\\x05' b'\\x89\\x06\\xad\\xc6' _sym_external_foo17___2298916294 b'\\x05' b'\\xe4%\\xac\\xd1' _sym_external_foo4___3827674321 b'\\x05' b'yj\\x01\\xac' _sym_external_foo7___2036990380 b'\\x05' b'\\xf1\\xe6K\\xe5' _sym_external_foo29___4058401765 b'\\x05' b'\\xd2\\x89X\\xb8' _sym_external_foo3___3532216504 b'\\x05' } { DATA _sym_bucket_2 b'\\x06p\\xffj' _sym_external_foo25___108068714 b'\\x05' b'\\x964\\x99I' _sym_external_foo24___2520029513 b'\\x05' b's\\x81\\xe7\\xc1' _sym_external_foo10___1937893313 b'\\x05' b'\\x85\\xad\\xc11' _sym_external_foo28___2242756913 b'\\x05' b'\\xfa"\\xb1\\xed' _sym_external_foo5___4196577773 b'\\x05' b'A\\xe7[\\x05' _sym_external_foo22___1105681157 b'\\x05' b'\\xd3\\x89U\\xe8' _sym_external_foo1___3548993000 b'\\x05' b'hL\\xf8\\xf3' _sym_external_foo20___1749874931 b'\\x05' } { DATA _sym_bucket_0 b'\\xee\\xd9\\x1d\\xe3' _sym_external_foo9___4007206371 b'\\x05' b'a\\xbc\\x1ch' _sym_external_foo16___1639717992 b'\\x05' b'\\xd3*\\xa7\\x0c' _sym_external_foo21___3542787852 b'\\x05' b'\\x18iG\\xd9' _sym_external_foo19___409552857 b'\\x05' b'\\n\\xf1\\xf9\\x7f' _sym_external_foo18___183630207 b'\\x05' b')\\xda\\xd7`' _sym_external_foo27___702207840 b'\\x05' b'2\\xf6\\xaa\\xda' _sym_external_foo12___855026394 b'\\x05' b'\\xbe\\xb5\\x05\\xf5' _sym_external_foo15___3199534581 b'\\x05' b'\\xfc\\xa7_\\xe6' _sym_external_foo8___4238827494 b'\\x05' b'\\x1b\\x12C8' _sym_external_foo26___454181688 b'\\x05' } }""" # noqa: E501
expected_asm = """{ DATA _sym_BUCKET_HEADERS b\'\\x0bB\' _sym_bucket_0 b\'\\n\' b\'+\\x8d\' _sym_bucket_1 b\'\\x0c\' b\'\\x00\\x85\' _sym_bucket_2 b\'\\x08\' } { DATA _sym_bucket_1 b\'\\xd8\\xee\\xa1\\xe8\' _sym_external 6 foo6()3639517672 b\'\\x05\' b\'\\xd2\\x9e\\xe0\\xf9\' _sym_external 0 foo0()3533627641 b\'\\x05\' b\'\\x05\\xf1\\xe0_\' _sym_external 2 foo2()99737695 b\'\\x05\' b\'\\x91\\t\\xb4{\' _sym_external 23 foo23()2433332347 b\'\\x05\' b\'np3\\x7f\' _sym_external 11 foo11()1852846975 b\'\\x05\' b\'&\\xf5\\x96\\xf9\' _sym_external 13 foo13()653629177 b\'\\x05\' b\'\\x04ga\\xeb\' _sym_external 14 foo14()73884139 b\'\\x05\' b\'\\x89\\x06\\xad\\xc6\' _sym_external 17 foo17()2298916294 b\'\\x05\' b\'\\xe4%\\xac\\xd1\' _sym_external 4 foo4()3827674321 b\'\\x05\' b\'yj\\x01\\xac\' _sym_external 7 foo7()2036990380 b\'\\x05\' b\'\\xf1\\xe6K\\xe5\' _sym_external 29 foo29()4058401765 b\'\\x05\' b\'\\xd2\\x89X\\xb8\' _sym_external 3 foo3()3532216504 b\'\\x05\' } { DATA _sym_bucket_2 b\'\\x06p\\xffj\' _sym_external 25 foo25()108068714 b\'\\x05\' b\'\\x964\\x99I\' _sym_external 24 foo24()2520029513 b\'\\x05\' b\'s\\x81\\xe7\\xc1\' _sym_external 10 foo10()1937893313 b\'\\x05\' b\'\\x85\\xad\\xc11\' _sym_external 28 foo28()2242756913 b\'\\x05\' b\'\\xfa"\\xb1\\xed\' _sym_external 5 foo5()4196577773 b\'\\x05\' b\'A\\xe7[\\x05\' _sym_external 22 foo22()1105681157 b\'\\x05\' b\'\\xd3\\x89U\\xe8\' _sym_external 1 foo1()3548993000 b\'\\x05\' b\'hL\\xf8\\xf3\' _sym_external 20 foo20()1749874931 b\'\\x05\' } { DATA _sym_bucket_0 b\'\\xee\\xd9\\x1d\\xe3\' _sym_external 9 foo9()4007206371 b\'\\x05\' b\'a\\xbc\\x1ch\' _sym_external 16 foo16()1639717992 b\'\\x05\' b\'\\xd3*\\xa7\\x0c\' _sym_external 21 foo21()3542787852 b\'\\x05\' b\'\\x18iG\\xd9\' _sym_external 19 foo19()409552857 b\'\\x05\' b\'\\n\\xf1\\xf9\\x7f\' _sym_external 18 foo18()183630207 b\'\\x05\' b\')\\xda\\xd7`\' _sym_external 27 foo27()702207840 b\'\\x05\' b\'2\\xf6\\xaa\\xda\' _sym_external 12 foo12()855026394 b\'\\x05\' b\'\\xbe\\xb5\\x05\\xf5\' _sym_external 15 foo15()3199534581 b\'\\x05\' b\'\\xfc\\xa7_\\xe6\' _sym_external 8 foo8()4238827494 b\'\\x05\' b\'\\x1b\\x12C8\' _sym_external 26 foo26()454181688 b\'\\x05\' } }""" # noqa: E501
assert expected_asm in output["asm"]


Expand Down
Loading
Loading