v2 / vlib / v / gen / c / testdata / global_const_export_nix.vv
23 lines · 18 sloc · 326 bytes · ec451e67020f5bb2732fb69cd674827b95a934cd
Raw
1// vtest vflags: -enable-globals
2@[has_globals]
3module main
4
5struct Entry {
6 value int
7}
8
9@[export]
10__global const exported_const = int(123)
11
12__global const entry = Entry{
13 value: 123
14}
15
16@[c_extern]
17__global const C.external_symbol int
18
19fn main() {
20 println(C.external_symbol)
21 println(exported_const)
22 println(entry.value)
23}
24