zig
zig copied to clipboard
C backend fixes
This enabled all of the behavior tests for the C backend that were passing and fixed all of the C warnings from the flags -Wextra -Wall -pedantic for the behavior tests except various unused (but set) and uninitalized (only with safety off) warnings, and then fixes a bunch of disabled behavior tests.
Some notable C backend milestones achieved with these changes:
- The C backend is now passing 87% (1191/1366) of the behavior tests vs the LLVM backend.
- The official hello world now works on at least
x86_64-linux(with and without libc). - The test runner now prints output to the console.
Fixes #12751 Fixes #11651
I know this PR is still in draft, but could you extract 1cc6a95 into its own PR? It will make this and the new PR easier to review and we can merge the fixes separately from the C backend improvements. Especially as the fix contains changes to all of the native backends also, which was quite easy to miss from the title and description of this PR.
Looking forward to this!
std: add cbe hacks to more targets
Interesting :thinking:
I'm going to look into enhancing the lowering of inline assembly, so that it can automatically do these transforms (e.g. turning "{x8}" to "{i}" and inserting a "mov" when inside a naked function body). In the meantime, these hacks are nice workarounds :+1:
Related: #13278
Is this still intentionally a draft, or are you perhaps looking for review & merge now?
This is in as good a state as any to review and merge. I can always open a new PR with further fixes.