mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
27 lines
363 B
V
27 lines
363 B
V
|
|
||
|
fn test_bitness(){
|
||
|
mut x := 0
|
||
|
$if x32 {
|
||
|
println('system is 32 bit')
|
||
|
x = 1
|
||
|
}
|
||
|
$if x64 {
|
||
|
println('system is 64 bit')
|
||
|
x = 2
|
||
|
}
|
||
|
assert x > 0
|
||
|
}
|
||
|
|
||
|
fn test_endianness(){
|
||
|
mut x := 0
|
||
|
$if little_endian {
|
||
|
println('system is little endian')
|
||
|
x = 1
|
||
|
}
|
||
|
$if big_endian {
|
||
|
println('system is big endian')
|
||
|
x = 2
|
||
|
}
|
||
|
assert x > 0
|
||
|
}
|