File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
test/libsolidity/semanticTests Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -4029,7 +4029,7 @@ string YulUtilFunctions::negateNumberWrappingFunction(Type const& _type)
4029
4029
IntegerType const & type = dynamic_cast <IntegerType const &>(_type);
4030
4030
solAssert (type.isSigned (), " Expected signed type!" );
4031
4031
4032
- string const functionName = " negate_ " + _type.identifier ();
4032
+ string const functionName = " negate_wrapping_ " + _type.identifier ();
4033
4033
return m_functionCollector.createFunction (functionName, [&]() {
4034
4034
return Whiskers (R"(
4035
4035
function <functionName>(value) -> ret {
Original file line number Diff line number Diff line change @@ -50,11 +50,11 @@ contract test {
50
50
// compileViaYul: also
51
51
// ----
52
52
// constructor()
53
- // gas irOptimized: 1947094
53
+ // gas irOptimized: 1965559
54
54
// gas legacy: 2602700
55
55
// gas legacyOptimized: 1874490
56
56
// div(int256,int256): 3141592653589793238, 88714123 -> 35412542528203691288251815328
57
- // gas irOptimized: 22222
57
+ // gas irOptimized: 22244
58
58
// gas legacy: 22767
59
59
// gas legacyOptimized: 22282
60
60
// exp(int256): 3141592653589793238 -> 23140692632779268978
@@ -82,7 +82,7 @@ contract test {
82
82
// gas legacy: 22807
83
83
// gas legacyOptimized: 22295
84
84
// pow(int256,uint256): 3141592653589793238, 5 -> 306019684785281453040
85
- // gas irOptimized: 22863
85
+ // gas irOptimized: 22861
86
86
// gas legacy: 23508
87
87
// gas legacyOptimized: 22921
88
88
// sqrt(int256): 3141592653589793238 -> 1772453850905516027
Original file line number Diff line number Diff line change
1
+ contract C {
2
+ function f () public pure {
3
+ - (int8 (0 ));
4
+ unchecked {
5
+ // Used to incorrectly use the checked unary negation function and revert.
6
+ (- (type (int8 ).min));
7
+ }
8
+ }
9
+ }
10
+ // ====
11
+ // compileViaYul: also
12
+ // ----
13
+ // f() ->
You can’t perform that action at this time.
0 commit comments