aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/smtCheckerTests/special/gasleft.sol
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/smtCheckerTests/special/gasleft.sol')
-rw-r--r--test/libsolidity/smtCheckerTests/special/gasleft.sol14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/libsolidity/smtCheckerTests/special/gasleft.sol b/test/libsolidity/smtCheckerTests/special/gasleft.sol
new file mode 100644
index 00000000..857230fe
--- /dev/null
+++ b/test/libsolidity/smtCheckerTests/special/gasleft.sol
@@ -0,0 +1,14 @@
+pragma experimental SMTChecker;
+
+contract C
+{
+ function f() public view {
+ assert(gasleft() > 0);
+ uint g = gasleft();
+ assert(g < gasleft());
+ assert(g >= gasleft());
+ }
+}
+// ----
+// Warning: (76-97): Assertion violation happens here
+// Warning: (123-144): Assertion violation happens here