aboutsummaryrefslogtreecommitdiffhomepage
path: root/cgo/testdata/symbols.go
diff options
context:
space:
mode:
Diffstat (limited to 'cgo/testdata/symbols.go')
-rw-r--r--cgo/testdata/symbols.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/cgo/testdata/symbols.go b/cgo/testdata/symbols.go
new file mode 100644
index 000000000..c724cd921
--- /dev/null
+++ b/cgo/testdata/symbols.go
@@ -0,0 +1,23 @@
+package main
+
+/*
+// Function signatures.
+int foo(int a, int b);
+void variadic0();
+void variadic2(int x, int y, ...);
+
+// Global variable signatures.
+extern int someValue;
+*/
+import "C"
+
+// Test function signatures.
+func accessFunctions() {
+ C.foo(3, 4)
+ C.variadic0()
+ C.variadic2(3, 5)
+}
+
+func accessGlobals() {
+ _ = C.someValue
+}