Commit 912c1c24c3
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);
+}