Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
fns
/
fixed_array_on_voidptr_test.v
11
lines
·
11
sloc
·
206 bytes
·
1e5b3d354a97bb0096ed1128c32a3c95abb51303
Raw
1
fn
test_main() {
2
mut
b := [2]int{}
3
b[0] = 1
4
b[1] = 2
5
mut
a := unsafe { memdup(b, $
if
new_int ? && x64 { 16 } $
else
{ 8 }) }
6
x := unsafe { &int(a) }
7
unsafe {
8
assert x[0] == 1
9
assert x[1] == 2
10
}
11
}
12