mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 03:51:01 +00:00
94ec34c4d5
Separate between compilation and linker phases to allow deploy time linking and back-porting era compiler changes to fix #91. Unlinked contract binaries (caused by missing libraries or missing factory dependencies in turn) are emitted as raw ELF object. Few drive by fixes: - #98 - A compiler panic on missing libraries definitions. - Fixes some incosistent type forwarding in JSON output (empty string vs. null object). - Remove the unused fallback for size optimization setting. - Remove the broken `--lvm-ir` mode. - CI workflow fixes. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com> Signed-off-by: xermicus <bigcyrill@hotmail.com> Signed-off-by: xermicus <cyrill@parity.io>
41 lines
897 B
Rust
41 lines
897 B
Rust
//! The Solidity compiler unit tests for remappings.
|
|
|
|
use crate::test_utils::{build_solidity_with_options, sources};
|
|
|
|
#[test]
|
|
fn default() {
|
|
let callee_code = r#"
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity >=0.4.16;
|
|
|
|
contract Callable {
|
|
function f(uint a) public pure returns(uint) {
|
|
return a * 2;
|
|
}
|
|
}"#;
|
|
|
|
let caller_code = r#"
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity >=0.4.16;
|
|
|
|
import "libraries/default/callable.sol";
|
|
|
|
contract Main {
|
|
function main(Callable callable) public returns(uint) {
|
|
return callable.f(5);
|
|
}
|
|
}"#;
|
|
|
|
build_solidity_with_options(
|
|
sources(&[("./test.sol", caller_code), ("./callable.sol", callee_code)]),
|
|
Default::default(),
|
|
["libraries/default/=./".to_owned()].into(),
|
|
revive_llvm_context::OptimizerSettings::cycles(),
|
|
true,
|
|
Default::default(),
|
|
)
|
|
.unwrap();
|
|
}
|