Test require with string literals

fixes #6651
This commit is contained in:
Mathias Baumann 2019-09-11 12:26:31 +02:00
parent 50a015acf0
commit c74b1daef2
2 changed files with 20 additions and 4 deletions

View File

@ -5,4 +5,4 @@
"compiler-fixed": "off",
"no-inline-assembly": "off"
}
}
}

View File

@ -12,17 +12,33 @@ contract C {
x = true;
require(true);
}
/* Not properly supported by test system yet
function f2(bool a) public pure returns (bool x) {
x = a;
string memory message;
message = "fancy message!";
require(a, message);
}*/
}
function f3(bool a) public pure returns (bool x) {
x = a;
require(a, "msg");
}
function f4(bool a) public pure returns (bool x) {
x = a;
string memory message;
require(a, message);
}
}
// ====
// compileViaYul: true
// compileViaYul: also
// EVMVersion: >=byzantium
// ----
// f(bool): true -> true
// f(bool): false -> FAILURE
// fail() -> FAILURE
// succeed() -> true
// f2(bool): true -> true
// f2(bool): false -> FAILURE, hex"08c379a0", 0x20, 14, "fancy message!"
// f3(bool): true -> true
// f3(bool): false -> FAILURE, hex"08c379a0", 0x20, 3, "msg"
// f4(bool): true -> true
// f4(bool): false -> FAILURE, hex"08c379a0", 0x20, 0