Skip to content

Commit 3b6fdc2

Browse files
Update smt tests
1 parent d97549f commit 3b6fdc2

File tree

122 files changed

+445
-2240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+445
-2240
lines changed

test/cmdlineTests/model_checker_targets_all_all_engines/err

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
Warning: 'transfer' is deprecated and scheduled for removal in the next breaking version (0.9). Use 'call{value: <amount>}("")' instead.
2-
--> input.sol:10:3:
3-
|
4-
10 | a.transfer(x);
5-
| ^^^^^^^^^^
6-
71
Warning: CHC: Underflow (resulting value less than 0) happens here.
82
Counterexample:
93
arr = []
104
a = 0x0
115
x = 0
6+
success = false
127

138
Transaction trace:
149
test.constructor()
@@ -24,6 +19,7 @@ Counterexample:
2419
arr = []
2520
a = 0x0
2621
x = 1
22+
success = false
2723

2824
Transaction trace:
2925
test.constructor()
@@ -39,6 +35,7 @@ Counterexample:
3935
arr = []
4036
a = 0x0
4137
x = 0
38+
success = false
4239

4340
Transaction trace:
4441
test.constructor()
@@ -54,48 +51,52 @@ Counterexample:
5451
arr = []
5552
a = 0x0
5653
x = 0
54+
success = true
5755

5856
Transaction trace:
5957
test.constructor()
6058
State: arr = []
6159
test.f(0x0, 1)
62-
--> input.sol:11:3:
60+
a.call{value: x}("") -- untrusted external call
61+
--> input.sol:12:3:
6362
|
64-
11 | assert(x > 0);
63+
12 | assert(x > 0);
6564
| ^^^^^^^^^^^^^
6665

6766
Warning: CHC: Empty array "pop" happens here.
6867
Counterexample:
6968
arr = []
7069
a = 0x0
7170
x = 0
71+
success = true
7272

7373
Transaction trace:
7474
test.constructor()
7575
State: arr = []
7676
test.f(0x0, 1)
77-
--> input.sol:12:3:
77+
a.call{value: x}("") -- untrusted external call
78+
--> input.sol:13:3:
7879
|
79-
12 | arr.pop();
80+
13 | arr.pop();
8081
| ^^^^^^^^^
8182

8283
Warning: CHC: Out of bounds access happens here.
8384
Counterexample:
8485
arr = []
8586
a = 0x0
8687
x = 0
88+
success = true
8789

8890
Transaction trace:
8991
test.constructor()
9092
State: arr = []
9193
test.f(0x0, 1)
92-
--> input.sol:13:3:
94+
a.call{value: x}("") -- untrusted external call
95+
--> input.sol:14:3:
9396
|
94-
13 | arr[x];
97+
14 | arr[x];
9598
| ^^^^^^
9699

97-
Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
98-
99100
Warning: BMC: Condition is always true.
100101
--> input.sol:6:11:
101102
|

test/cmdlineTests/model_checker_targets_all_all_engines/input.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ contract test {
77
--x;
88
x + type(uint).max;
99
2 / x;
10-
a.transfer(x);
10+
(bool success, ) = a.call{value: x}("");
11+
require(success);
1112
assert(x > 0);
1213
arr.pop();
1314
arr[x];
1415
}
15-
}
16+
}
Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
Warning: 'transfer' is deprecated and scheduled for removal in the next breaking version (0.9). Use 'call{value: <amount>}("")' instead.
2-
--> input.sol:10:3:
3-
|
4-
10 | a.transfer(x);
5-
| ^^^^^^^^^^
6-
71
Warning: BMC: Condition is always true.
82
--> input.sol:6:11:
93
|
@@ -19,10 +13,12 @@ Warning: BMC: Underflow (resulting value less than 0) happens here.
1913
Note: Counterexample:
2014
<result> = (- 1)
2115
a = 0
16+
success = false
2217
x = 0
2318

2419
Note: Callstack:
25-
Note:
20+
Note:
21+
Note that external function calls are not inlined, even if the source code of the function is available. This is due to the possibility that the actual called contract has the same ABI but implements the function differently.
2622

2723
Warning: BMC: Overflow (resulting value larger than 2**256 - 1) happens here.
2824
--> input.sol:8:3:
@@ -32,10 +28,12 @@ Warning: BMC: Overflow (resulting value larger than 2**256 - 1) happens here.
3228
Note: Counterexample:
3329
<result> = 2**256
3430
a = 0
31+
success = false
3532
x = 1
3633

3734
Note: Callstack:
38-
Note:
35+
Note:
36+
Note that external function calls are not inlined, even if the source code of the function is available. This is due to the possibility that the actual called contract has the same ABI but implements the function differently.
3937

4038
Warning: BMC: Division by zero happens here.
4139
--> input.sol:9:3:
@@ -45,31 +43,23 @@ Warning: BMC: Division by zero happens here.
4543
Note: Counterexample:
4644
<result> = 0
4745
a = 0
46+
success = false
4847
x = 0
4948

5049
Note: Callstack:
51-
Note:
52-
53-
Warning: BMC: Insufficient funds happens here.
54-
--> input.sol:10:3:
55-
|
56-
10 | a.transfer(x);
57-
| ^^^^^^^^^^^^^
58-
Note: Counterexample:
59-
a = 0
60-
x = 0
61-
62-
Note: Callstack:
63-
Note:
50+
Note:
51+
Note that external function calls are not inlined, even if the source code of the function is available. This is due to the possibility that the actual called contract has the same ABI but implements the function differently.
6452

6553
Warning: BMC: Assertion violation happens here.
66-
--> input.sol:11:3:
54+
--> input.sol:12:3:
6755
|
68-
11 | assert(x > 0);
56+
12 | assert(x > 0);
6957
| ^^^^^^^^^^^^^
7058
Note: Counterexample:
7159
a = 0
60+
success = true
7261
x = 0
7362

7463
Note: Callstack:
75-
Note:
64+
Note:
65+
Note that external function calls are not inlined, even if the source code of the function is available. This is due to the possibility that the actual called contract has the same ABI but implements the function differently.

test/cmdlineTests/model_checker_targets_all_bmc/input.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ contract test {
77
--x;
88
x + type(uint).max;
99
2 / x;
10-
a.transfer(x);
10+
(bool success, ) = a.call{value: x}("");
11+
require(success);
1112
assert(x > 0);
1213
arr.pop();
1314
arr[x];
1415
}
15-
}
16+
}

test/cmdlineTests/model_checker_targets_all_chc/err

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
Warning: 'transfer' is deprecated and scheduled for removal in the next breaking version (0.9). Use 'call{value: <amount>}("")' instead.
2-
--> input.sol:10:3:
3-
|
4-
10 | a.transfer(x);
5-
| ^^^^^^^^^^
6-
71
Warning: CHC: Underflow (resulting value less than 0) happens here.
82
Counterexample:
93
arr = []
104
a = 0x0
115
x = 0
6+
success = false
127

138
Transaction trace:
149
test.constructor()
@@ -24,6 +19,7 @@ Counterexample:
2419
arr = []
2520
a = 0x0
2621
x = 1
22+
success = false
2723

2824
Transaction trace:
2925
test.constructor()
@@ -39,6 +35,7 @@ Counterexample:
3935
arr = []
4036
a = 0x0
4137
x = 0
38+
success = false
4239

4340
Transaction trace:
4441
test.constructor()
@@ -54,44 +51,48 @@ Counterexample:
5451
arr = []
5552
a = 0x0
5653
x = 0
54+
success = true
5755

5856
Transaction trace:
5957
test.constructor()
6058
State: arr = []
6159
test.f(0x0, 1)
62-
--> input.sol:11:3:
60+
a.call{value: x}("") -- untrusted external call
61+
--> input.sol:12:3:
6362
|
64-
11 | assert(x > 0);
63+
12 | assert(x > 0);
6564
| ^^^^^^^^^^^^^
6665

6766
Warning: CHC: Empty array "pop" happens here.
6867
Counterexample:
6968
arr = []
7069
a = 0x0
7170
x = 0
71+
success = true
7272

7373
Transaction trace:
7474
test.constructor()
7575
State: arr = []
7676
test.f(0x0, 1)
77-
--> input.sol:12:3:
77+
a.call{value: x}("") -- untrusted external call
78+
--> input.sol:13:3:
7879
|
79-
12 | arr.pop();
80+
13 | arr.pop();
8081
| ^^^^^^^^^
8182

8283
Warning: CHC: Out of bounds access happens here.
8384
Counterexample:
8485
arr = []
8586
a = 0x0
8687
x = 0
88+
success = true
8789

8890
Transaction trace:
8991
test.constructor()
9092
State: arr = []
9193
test.f(0x0, 1)
92-
--> input.sol:13:3:
94+
a.call{value: x}("") -- untrusted external call
95+
--> input.sol:14:3:
9396
|
94-
13 | arr[x];
97+
14 | arr[x];
9598
| ^^^^^^
96-
97-
Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.

test/cmdlineTests/model_checker_targets_all_chc/input.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ contract test {
77
--x;
88
x + type(uint).max;
99
2 / x;
10-
a.transfer(x);
10+
(bool success, ) = a.call{value: x}("");
11+
require(success);
1112
assert(x > 0);
1213
arr.pop();
1314
arr[x];
1415
}
15-
}
16+
}
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
Warning: 'transfer' is deprecated and scheduled for removal in the next breaking version (0.9). Use 'call{value: <amount>}("")' instead.
2-
--> input.sol:10:3:
3-
|
4-
10 | a.transfer(x);
5-
| ^^^^^^^^^^
6-
71
Warning: BMC: Assertion violation happens here.
8-
--> input.sol:11:3:
2+
--> input.sol:12:3:
93
|
10-
11 | assert(x > 0);
4+
12 | assert(x > 0);
115
| ^^^^^^^^^^^^^
126
Note: Counterexample:
137
a = 0
8+
success = true
149
x = 0
1510

1611
Note: Callstack:
17-
Note:
12+
Note:
13+
Note that external function calls are not inlined, even if the source code of the function is available. This is due to the possibility that the actual called contract has the same ABI but implements the function differently.

test/cmdlineTests/model_checker_targets_assert_bmc/input.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ contract test {
77
--x;
88
x + type(uint).max;
99
2 / x;
10-
a.transfer(x);
10+
(bool success, ) = a.call{value: x}("");
11+
require(success);
1112
assert(x > 0);
1213
arr.pop();
1314
arr[x];
1415
}
15-
}
16+
}
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
Warning: 'transfer' is deprecated and scheduled for removal in the next breaking version (0.9). Use 'call{value: <amount>}("")' instead.
2-
--> input.sol:10:3:
3-
|
4-
10 | a.transfer(x);
5-
| ^^^^^^^^^^
6-
71
Warning: CHC: Assertion violation happens here.
82
Counterexample:
93
arr = []
104
a = 0x0
115
x = 0
6+
success = true
127

138
Transaction trace:
149
test.constructor()
1510
State: arr = []
1611
test.f(0x0, 1)
17-
--> input.sol:11:3:
12+
a.call{value: x}("") -- untrusted external call
13+
--> input.sol:12:3:
1814
|
19-
11 | assert(x > 0);
15+
12 | assert(x > 0);
2016
| ^^^^^^^^^^^^^

test/cmdlineTests/model_checker_targets_assert_chc/input.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ contract test {
77
--x;
88
x + type(uint).max;
99
2 / x;
10-
a.transfer(x);
10+
(bool success, ) = a.call{value: x}("");
11+
require(success);
1112
assert(x > 0);
1213
arr.pop();
1314
arr[x];
1415
}
15-
}
16+
}

0 commit comments

Comments
 (0)