mirror of
https://github.com/ziglang/zig.git
synced 2026-01-10 09:25:11 +00:00
parent
35a374efe0
commit
8fef23a525
@ -15,6 +15,7 @@ comptime {
|
||||
_ = @import("behavior/bugs/1111.zig");
|
||||
_ = @import("behavior/bugs/1120.zig");
|
||||
_ = @import("behavior/bugs/1277.zig");
|
||||
_ = @import("behavior/bugs/1310.zig");
|
||||
_ = @import("behavior/bugs/1322.zig");
|
||||
_ = @import("behavior/bugs/1381.zig");
|
||||
_ = @import("behavior/bugs/1421.zig");
|
||||
|
||||
24
test/stage1/behavior/bugs/1310.zig
Normal file
24
test/stage1/behavior/bugs/1310.zig
Normal file
@ -0,0 +1,24 @@
|
||||
const std = @import("std");
|
||||
const expect = std.testing.expect;
|
||||
|
||||
pub const VM = ?[*]const struct_InvocationTable_;
|
||||
pub const struct_InvocationTable_ = extern struct {
|
||||
GetVM: ?extern fn (?[*]VM) c_int,
|
||||
};
|
||||
|
||||
pub const struct_VM_ = extern struct {
|
||||
functions: ?[*]const struct_InvocationTable_,
|
||||
};
|
||||
|
||||
//excised output from stdlib.h etc
|
||||
|
||||
pub const InvocationTable_ = struct_InvocationTable_;
|
||||
pub const VM_ = struct_VM_;
|
||||
|
||||
extern fn agent_callback(_vm: [*]VM, options: [*]u8) i32 {
|
||||
return 11;
|
||||
}
|
||||
|
||||
test "fixed" {
|
||||
expect(agent_callback(undefined, undefined) == 11);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user