mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-23 22:45:14 +00:00
![]() In #3352 an optimization to transform `ra = .field` into ``` ra = \#rcd -[ra]-> #rcd.field ``` rather than ``` __ra1 = \#rcd -[__ra1] -> #rcd.field ra = LambdaSet { __ra1 } ``` was introduced. However, this optimization is not correct when `ra = .field` is defined as a toplevel thunk, for in such situations we indeed want the thunk `ra` to return the lambda set it resolves to, rather than repointing at itself. Besides reverting this change, another option would be to convert accessors into closures before translation of Can to IR. However, this complicates the translation algorithm more than it already is, and I'd like to avoid additional special-cases. Closes #4606 |
||
---|---|---|
.. | ||
benches | ||
src | ||
.gitignore | ||
build.rs | ||
Cargo.toml | ||
README.md |
Running our CodeGen tests
Our code generation tests are all in this crate. Feature flags are used to run the tests with a specific backend. For convenience, some aliases are added in .cargo/config
:
[alias]
test-gen-llvm = "test -p test_gen"
test-gen-dev = "test -p test_gen --no-default-features --features gen-dev"
test-gen-wasm = "test -p test_gen --no-default-features --features gen-wasm"
So we can run:
cargo test-gen-llvm
To run the gen tests with the LLVM backend. To filter tests, append a filter like so:
> cargo test-gen-wasm wasm_str::small
Finished test [unoptimized + debuginfo] target(s) in 0.13s
Running src/tests.rs (target/debug/deps/test_gen-b4ad63a9dd50f050)
running 2 tests
test wasm_str::small_str_literal ... ok
test wasm_str::small_str_zeroed_literal ... ok