1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

[FunC] Enrich testing framework, add code hash checking

@code_hash to match (boc) hash of compiled.fif against expected.
While being much less flexible than @fif_codegen, it nevertheless
gives a guarantee of bytecode stability on compiler modifications.
This commit is contained in:
Aleksandr Kirsanov 2024-04-27 14:32:16 +05:00
parent 18050a7591
commit c74e49d467
No known key found for this signature in database
GPG key ID: B758BBAA01FFB3D3
10 changed files with 105 additions and 2 deletions

View file

@ -61,6 +61,15 @@ global int xx;
return (xx, xx~inc(xx / 20), xx, xx = xx * 2, xx, xx += 1, xx);
}
(int, int, int, int, int) test_if_else(int x) method_id(20) {
if (x > 10) {
return (x~inc(8), x + 1, x = 1, x <<= 3, x);
} else {
xx = 9;
return (x, x~inc(-4), x~inc(-1), x >= 1, x = x + xx);
}
}
() main() {
}
@ -75,4 +84,8 @@ TESTCASE | 16 | 100 | 100 50 105 210 210 211 211
TESTCASE | 17 | 100 | 100 50 105 210 210 211 211
TESTCASE | 18 | 100 | 210 210 211 211 100 50 105
TESTCASE | 19 | 100 | 100 50 105 210 210 211 211
TESTCASE | 20 | 80 | 80 89 1 8 8
TESTCASE | 20 | 9 | 9 -40 -10 -1 13
@code_hash 67078680159561921827850021610104736412668316252257881932102553152922274405210
-}