v2 / vlib / v / tests / include_c_gen_fn_headers / include_c.v
16 lines · 12 sloc · 271 bytes · 8b991b158417aa21f0b0d8fa87af53df90272744
Raw
1#flag -I.
2#include "cheader.h"
3
4// fn C.hello_from_c()
5
6// fn C.add_two_numbers(a int, b int) int
7
8fn test_include_c_autogen_of_fn_definitions() {
9 C.hello_from_c()
10 x := C.add_two_numbers(2, 3)
11 assert x == 5
12}
13
14fn main() {
15 test_include_c_autogen_of_fn_definitions()
16}
17