Open mitchellh opened 2 years ago
After fixing a few stage2 bugs I reduced this to:
pub inline fn _IOC(inout: anytype, len: anytype) @TypeOf(inout | len) {
return 0;
}
pub inline fn _IO() @TypeOf(_IOC(@as(u32, 0), @as(c_int, 0))) {
return 0;
}
test {
std.log.warn("result={}", .{_IO()});
}
which means that this stopped working due to 4e134f6dcb02000151c395718eb2c24977100013 but since I can reproduce it without using inline call arguments it's a bug in translate-c that has always existed:
// a.c
int a;
unsigned b;
#define FOO() (a | b)
const c = @cImport({
@cInclude("a.c");
});
test {
std.log.warn("result={}", .{c.FOO()});
}
Zig Version
0.10.0-dev.4544+0ae60f723
Steps to Reproduce
Expected Behavior
This was working at some point in the past ~10 commits, and is newly broken. (Or it shouldn't have been working and a new bug is exposed)
Actual Behavior
The test passes with
-fstage1
Here is the full generated cimport.zig if that is helpful: https://gist.github.com/mitchellh/f7ea026926326230e61f5d4601701e83