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

func/fift: bugfixes

This commit is contained in:
ton 2019-10-09 20:00:54 +04:00
parent f67f5d879b
commit 38c3e39066
41 changed files with 248 additions and 99 deletions

20
crypto/func/test/b3.fc Normal file
View file

@ -0,0 +1,20 @@
;; inline test
_ unpack() inline {
var ds = get_data().begin_parse();
var res = (ds~load_uint(8), ds~load_int(32), ds~load_int(32));
return res;
}
() pack(a, x, y) impure inline_ref {
set_data(begin_cell()
.store_uint(a, 8)
.store_int(x, 32)
.store_int(y, 32)
.end_cell());
}
() main() impure {
var (a, x, y) = unpack();
x += y;
pack(a, x, y);
}

9
crypto/func/test/w1.fc Normal file
View file

@ -0,0 +1,9 @@
(int, int) nested_if(int id) method_id {
dump_stack();
if (id > 0) {
if (id > 10) {
return (2 * id, 3 * id);
}
}
return (5, 6);
}

14
crypto/func/test/w2.fc Normal file
View file

@ -0,0 +1,14 @@
_ f(cs) {
return (cs~load_uint(8), cs~load_uint(8), cs~load_uint(8), cs~load_uint(8),
cs~load_uint(8), cs~load_uint(8), cs~load_uint(8), cs~load_uint(8),
cs~load_uint(8), cs~load_uint(8), cs~load_uint(8), cs~load_uint(8),
cs~load_uint(8), cs~load_uint(8), cs~load_uint(8), cs~load_uint(8),
cs~load_uint(8), cs~load_uint(8), cs~load_uint(8), cs~load_uint(8));
}
_ main(cs) {
var (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10,
x11, x12, x13, x14, x15, x16, x17, x18, x19) = f(cs);
return x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
+ x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19;
}