Skip to content

Commit

Permalink
Added test for issue ziglang#9402.
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-z committed Sep 14, 2021
1 parent 4fcd3bd commit fd6f59c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/standalone.zig
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ pub fn addCases(cases: *tests.StandaloneContext) void {
}
cases.addBuildFile("test/standalone/c_compiler/build.zig", .{ .build_modes = true, .cross_targets = true });

if (std.Target.current.os.tag == .windows) {
cases.addC("test/standalone/issue_9402/main.zig");
}
// Try to build and run a PIE executable.
if (std.Target.current.os.tag == .linux) {
cases.addBuildFile("test/standalone/pie/build.zig", .{});
Expand Down
14 changes: 14 additions & 0 deletions test/standalone/issue_9402/main.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const FILE = extern struct {
dummy_field: u8,
};

extern fn _ftelli64([*c]FILE) i64;
extern fn _fseeki64([*c]FILE, i64, c_int) c_int;

pub export fn main(argc: c_int, argv: **u8) c_int {
_ = argv;
_ = argc;
_ = _ftelli64(null);
_ = _fseeki64(null, 123, 2);
return 0;
}

0 comments on commit fd6f59c

Please sign in to comment.