github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/cgo/testdata/symbols.go (about)

     1  package main
     2  
     3  /*
     4  // Function signatures.
     5  int foo(int a, int b);
     6  void variadic0();
     7  void variadic2(int x, int y, ...);
     8  static void staticfunc(int x);
     9  
    10  // Global variable signatures.
    11  extern int someValue;
    12  */
    13  import "C"
    14  
    15  // Test function signatures.
    16  func accessFunctions() {
    17  	C.foo(3, 4)
    18  	C.variadic0()
    19  	C.variadic2(3, 5)
    20  	C.staticfunc(3)
    21  }
    22  
    23  func accessGlobals() {
    24  	_ = C.someValue
    25  }