diff --git a/test/libsolidity/syntaxTests/inlineAssembly/evm_byzantium.sol b/test/libsolidity/syntaxTests/inlineAssembly/evm_byzantium.sol new file mode 100644 index 000000000..b08172ebe --- /dev/null +++ b/test/libsolidity/syntaxTests/inlineAssembly/evm_byzantium.sol @@ -0,0 +1,16 @@ +contract C { + function f() pure external { + assembly { + let s := returndatasize() + returndatacopy(0, 0, s) + } + } + function g() view external returns (uint ret) { + assembly { + ret := staticcall(0, gas(), 0, 0, 0, 0) + } + } +} +// ==== +// EVMVersion: >=byzantium +// ---- diff --git a/test/libsolidity/syntaxTests/inlineAssembly/evm_byzantium_on_homestead.sol b/test/libsolidity/syntaxTests/inlineAssembly/evm_byzantium_on_homestead.sol new file mode 100644 index 000000000..bbb32299f --- /dev/null +++ b/test/libsolidity/syntaxTests/inlineAssembly/evm_byzantium_on_homestead.sol @@ -0,0 +1,21 @@ +contract C { + function f() pure external { + assembly { + let s := returndatasize() + returndatacopy(0, 0, s) + } + } + function g() view external returns (uint ret) { + assembly { + ret := staticcall(0, gas(), 0, 0, 0, 0) + } + } +} +// ==== +// EVMVersion: =homestead +// ---- +// TypeError 7756: (86-100): The "returndatasize" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead"). +// DeclarationError 3812: (77-102): Variable count mismatch: 1 variables and 0 values. +// TypeError 7756: (115-129): The "returndatacopy" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead"). +// TypeError 1503: (245-255): The "staticcall" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead"). +// DeclarationError 8678: (238-277): Variable count does not match number of values (1 vs. 0) diff --git a/test/libsolidity/syntaxTests/inlineAssembly/evm_constantinople.sol b/test/libsolidity/syntaxTests/inlineAssembly/evm_constantinople.sol new file mode 100644 index 000000000..75d2f2895 --- /dev/null +++ b/test/libsolidity/syntaxTests/inlineAssembly/evm_constantinople.sol @@ -0,0 +1,17 @@ +contract C { + function f() view external returns (uint ret) { + assembly { + ret := shl(gas(), 5) + ret := shr(ret, 2) + ret := sar(ret, 2) + } + } + function g() external returns (address ret) { + assembly { + ret := create2(0, 0, 0, 0) + } + } +} +// ==== +// EVMVersion: >=constantinople +// ---- diff --git a/test/libsolidity/syntaxTests/inlineAssembly/evm_constantinople_on_byzantium.sol b/test/libsolidity/syntaxTests/inlineAssembly/evm_constantinople_on_byzantium.sol new file mode 100644 index 000000000..1e6d85bf1 --- /dev/null +++ b/test/libsolidity/syntaxTests/inlineAssembly/evm_constantinople_on_byzantium.sol @@ -0,0 +1,25 @@ +contract C { + function f() view external returns (uint ret) { + assembly { + ret := shl(gas(), 5) + ret := shr(ret, 2) + ret := sar(ret, 2) + } + } + function g() external returns (address ret) { + assembly { + ret := create2(0, 0, 0, 0) + } + } +} +// ==== +// EVMVersion: =byzantium +// ---- +// TypeError 6612: (103-106): The "shl" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium"). +// DeclarationError 8678: (96-116): Variable count does not match number of values (1 vs. 0) +// TypeError 6612: (136-139): The "shr" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium"). +// DeclarationError 8678: (129-147): Variable count does not match number of values (1 vs. 0) +// TypeError 6612: (167-170): The "sar" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium"). +// DeclarationError 8678: (160-178): Variable count does not match number of values (1 vs. 0) +// TypeError 6166: (283-290): The "create2" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium"). +// DeclarationError 8678: (276-302): Variable count does not match number of values (1 vs. 0) diff --git a/test/libsolidity/syntaxTests/inlineAssembly/istanbul.sol b/test/libsolidity/syntaxTests/inlineAssembly/evm_istanbul.sol similarity index 100% rename from test/libsolidity/syntaxTests/inlineAssembly/istanbul.sol rename to test/libsolidity/syntaxTests/inlineAssembly/evm_istanbul.sol diff --git a/test/libsolidity/syntaxTests/inlineAssembly/istanbul_on_petersburg.sol b/test/libsolidity/syntaxTests/inlineAssembly/evm_istanbul_on_petersburg.sol similarity index 83% rename from test/libsolidity/syntaxTests/inlineAssembly/istanbul_on_petersburg.sol rename to test/libsolidity/syntaxTests/inlineAssembly/evm_istanbul_on_petersburg.sol index dc15b61f9..66095a021 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/istanbul_on_petersburg.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/evm_istanbul_on_petersburg.sol @@ -13,7 +13,7 @@ contract C { // ==== // EVMVersion: =petersburg // ---- -// TypeError 7079: (101-108): The "chainid" instruction is only available for Istanbul-compatible VMs (you are currently compiling for "petersburg"). +// TypeError 1561: (101-108): The "chainid" instruction is only available for Istanbul-compatible VMs (you are currently compiling for "petersburg"). // DeclarationError 8678: (95-110): Variable count does not match number of values (1 vs. 0) -// TypeError 7079: (215-226): The "selfbalance" instruction is only available for Istanbul-compatible VMs (you are currently compiling for "petersburg"). +// TypeError 3672: (215-226): The "selfbalance" instruction is only available for Istanbul-compatible VMs (you are currently compiling for "petersburg"). // DeclarationError 8678: (209-228): Variable count does not match number of values (1 vs. 0)