mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 11:41:45 +00:00
More tests and fixes (unary, binary, globals)
This commit is contained in:
22
tests/compiler/if.ts
Normal file
22
tests/compiler/if.ts
Normal file
@ -0,0 +1,22 @@
|
||||
export function ifThenElse(n: i32): bool {
|
||||
if (n)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
export function ifThen(n: i32): bool {
|
||||
if (n)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
export function ifThenElseBlock(n: i32): bool {
|
||||
if (n) {
|
||||
; // nop
|
||||
return true;
|
||||
} else {
|
||||
; // nop
|
||||
return false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user