Merge branch 'cc-work' of https://github.com/LemonBoy/zig into LemonBoy-cc-work

This commit is contained in:
Andrew Kelley
2020-01-06 14:07:56 -05:00
54 changed files with 823 additions and 414 deletions

View File

@@ -9,6 +9,18 @@ test "zig fmt: change @typeOf to @TypeOf" {
);
}
// TODO: Remove nakedcc/stdcallcc once zig 0.6.0 is released. See https://github.com/ziglang/zig/pull/3977
test "zig fmt: convert nakedcc/stdcallcc into callconv(...)" {
try testTransform(
\\nakedcc fn foo1() void {}
\\stdcallcc fn foo2() void {}
,
\\fn foo1() callconv(.Naked) void {}
\\fn foo2() callconv(.Stdcall) void {}
\\
);
}
test "zig fmt: comptime struct field" {
try testCanonical(
\\const Foo = struct {
@@ -234,7 +246,7 @@ test "zig fmt: threadlocal" {
test "zig fmt: linksection" {
try testCanonical(
\\export var aoeu: u64 linksection(".text.derp") = 1234;
\\export nakedcc fn _start() linksection(".text.boot") noreturn {}
\\export fn _start() linksection(".text.boot") callconv(.Naked) noreturn {}
\\
);
}
@@ -2326,7 +2338,7 @@ test "zig fmt: fn type" {
\\
\\const a: fn (u8) u8 = undefined;
\\const b: extern fn (u8) u8 = undefined;
\\const c: nakedcc fn (u8) u8 = undefined;
\\const c: fn (u8) callconv(.Naked) u8 = undefined;
\\const ap: fn (u8) u8 = a;
\\
);