| 1 | const std = @import("std"); |
| 2 | const expect = std.testing.expect; |
| 3 | |
| 4 | extern fn add(a: u32, b: u32) u32; |
| 5 | extern var foo: u32; |
| 6 | |
| 7 | test "C add" { |
| 8 | const result = add(1, 2); |
| 9 | try expect(result == 3); |
| 10 | } |
| 11 | |
| 12 | test "C extern variable" { |
| 13 | try expect(foo == 12345); |
| 14 | } |