mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
test
This commit is contained in:
parent
5911fc81f8
commit
c22bf35ada
3 changed files with 17 additions and 0 deletions
2
vlib/v/gen/c/testdata/assign_fn_addr.c.must_have
vendored
Normal file
2
vlib/v/gen/c/testdata/assign_fn_addr.c.must_have
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
string (*cb2) (void) = &cb1;
|
||||||
|
string (*cb3) (void) = &cb2;
|
3
vlib/v/gen/c/testdata/assign_fn_addr.out
vendored
Normal file
3
vlib/v/gen/c/testdata/assign_fn_addr.out
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
true
|
||||||
|
true
|
||||||
|
true
|
12
vlib/v/gen/c/testdata/assign_fn_addr.vv
vendored
Normal file
12
vlib/v/gen/c/testdata/assign_fn_addr.vv
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
const hello = 'hello world!'
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
cb1 := fn () string {
|
||||||
|
return hello
|
||||||
|
}
|
||||||
|
cb2 := &cb1
|
||||||
|
cb3 := &cb2
|
||||||
|
println(voidptr(cb1) != voidptr(cb2))
|
||||||
|
println(voidptr(cb2) != voidptr(cb3))
|
||||||
|
println(voidptr(cb1) != voidptr(cb3))
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue