2020-03-09 21:14:07 +00:00
|
|
|
contract C {
|
|
|
|
function f() public {
|
|
|
|
assembly {
|
|
|
|
let d:= 0x10
|
|
|
|
|
2020-08-12 22:28:19 +00:00
|
|
|
function asmfun(a, b, c) -> x, y, z {
|
2020-03-09 21:14:07 +00:00
|
|
|
x := g(a)
|
2020-08-12 17:56:24 +00:00
|
|
|
function g(r) -> s {
|
2020-03-09 21:14:07 +00:00
|
|
|
s := mul(r, r)
|
|
|
|
}
|
|
|
|
y := g(b)
|
|
|
|
z := 7
|
|
|
|
}
|
|
|
|
let a1, b1, c1 := asmfun(1, 2, 3)
|
|
|
|
mstore(0x00, a1)
|
|
|
|
mstore(0x20, b1)
|
|
|
|
mstore(0x40, c1)
|
|
|
|
mstore(0x60, d)
|
|
|
|
return (0, 0x80)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
|
|
|
// f() -> 0x1, 0x4, 0x7, 0x10
|