Commit 912c1c24c3

Sahnvour <sahnvour@pm.me>
2019-09-21 17:42:00
simple test for exporting variables in static libs
1 parent 1bde3b6
Changed files (3)
test
standalone
static_c_lib
test/standalone/static_c_lib/foo.c
@@ -2,3 +2,5 @@
 uint32_t add(uint32_t a, uint32_t b) {
     return a + b;
 }
+
+uint32_t foo = 12345;
test/standalone/static_c_lib/foo.h
@@ -1,2 +1,3 @@
 #include <stdint.h>
 uint32_t add(uint32_t a, uint32_t b);
+extern uint32_t foo;
test/standalone/static_c_lib/foo.zig
@@ -6,3 +6,7 @@ test "C add" {
     const result = c.add(1, 2);
     expect(result == 3);
 }
+
+test "C extern variable" {
+    expect(c.foo == 12345);
+}