| author | |
| committer | |
| log | 912c1c24c32799c63949fdf466fccd31f84a1aa1 |
| tree | 3f14d8defcf90b62902a0249636fffc873e1c17c |
| parent | 1bde3b68218ecc25bfcc5e2304399294f83a74d8 |
3 files changed, 7 insertions(+), 0 deletions(-)
test/standalone/static_c_lib/foo.c+2| ... | @@ -2,3 +2,5 @@ | ... | @@ -2,3 +2,5 @@ |
| 2 | uint32_t add(uint32_t a, uint32_t b) { | 2 | uint32_t add(uint32_t a, uint32_t b) { |
| 3 | return a + b; | 3 | return a + b; |
| 4 | } | 4 | } |
| 5 | |||
| 6 | uint32_t foo = 12345; |
test/standalone/static_c_lib/foo.h+1| ... | @@ -1,2 +1,3 @@ | ... | @@ -1,2 +1,3 @@ |
| 1 | #include <stdint.h> | 1 | #include <stdint.h> |
| 2 | uint32_t add(uint32_t a, uint32_t b); | 2 | uint32_t add(uint32_t a, uint32_t b); |
| 3 | extern uint32_t foo; |
test/standalone/static_c_lib/foo.zig+4| ... | @@ -6,3 +6,7 @@ test "C add" { | ... | @@ -6,3 +6,7 @@ test "C add" { |
| 6 | const result = c.add(1, 2); | 6 | const result = c.add(1, 2); |
| 7 | expect(result == 3); | 7 | expect(result == 3); |
| 8 | } | 8 | } |
| 9 | |||
| 10 | test "C extern variable" { | ||
| 11 | expect(c.foo == 12345); | ||
| 12 | } |