assemblyscript/tests/compiler/inlining-blocklocals.ts

24 lines
464 B
TypeScript
Raw Normal View History

2019-03-20 14:16:18 +01:00
var b: i32 = 2;
var theCall_a: i32;
var theCall_b: i32;
var theCall_c: i32;
2019-03-20 14:16:18 +01:00
@inline function theCall(a: i32, b: i32, c: i32): void {
2019-03-20 14:16:18 +01:00
theCall_a = a;
theCall_b = b;
theCall_c = c;
2019-03-20 14:16:18 +01:00
}
function test(): void {
var a = 1;
// see comment in Compiler#makeCallInlinePrechecked
// theCall($3, $2=[except $3], $1=[except $3,$2])
theCall(a++, b++, ++a);
2019-03-20 14:16:18 +01:00
assert(theCall_a == 1);
assert(theCall_b == 2);
assert(theCall_c == 3);
assert(a == 3);
2019-03-20 14:16:18 +01:00
}
test();