mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
stage2: update stage2 tests with qualified import lib names for externs
From ```zig extern fn write(...); ``` to ```zig extern "c" fn write(...); ```
This commit is contained in:
parent
06a037bb95
commit
8f3be0e04f
@ -121,8 +121,8 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
|
||||
// Regular old hello world
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern fn exit(usize) noreturn;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn exit(usize) noreturn;
|
||||
\\
|
||||
\\pub export fn main() noreturn {
|
||||
\\ print();
|
||||
@ -141,7 +141,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
|
||||
// Now using start.zig without an explicit extern exit fn
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ print();
|
||||
@ -158,7 +158,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
|
||||
// Print it 4 times and force growth and realloc.
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ print();
|
||||
@ -182,7 +182,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
|
||||
// Print it once, and change the message.
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ print();
|
||||
@ -199,7 +199,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
|
||||
// Now we print it twice.
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ print();
|
||||
|
||||
@ -328,7 +328,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
.macos => {
|
||||
// While loops
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ var i: u32 = 0;
|
||||
@ -349,7 +349,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
|
||||
// inline while requires the condition to be comptime known.
|
||||
case.addError(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ var i: u32 = 0;
|
||||
@ -652,7 +652,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
.macos => {
|
||||
// Basic for loop
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ for ("hello") |_| print();
|
||||
@ -736,7 +736,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
}),
|
||||
.macos => try case.files.append(.{
|
||||
.src =
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn print() void {
|
||||
\\ _ = write(1, @ptrToInt("Hello, World!\n"), 14);
|
||||
@ -814,7 +814,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
}),
|
||||
.macos => try case.files.append(.{
|
||||
.src =
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\fn print() void {
|
||||
\\ _ = write(1, @ptrToInt("Hello, World!\n"), 14);
|
||||
\\}
|
||||
@ -1478,7 +1478,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
\\}
|
||||
, "HelloHello, World!\n"),
|
||||
.macos => case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ comptime var len: u32 = 5;
|
||||
@ -1550,7 +1550,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
\\}
|
||||
, "HeHelHellHello"),
|
||||
.macos => case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ comptime var i: u64 = 2;
|
||||
@ -2117,8 +2117,8 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
|
||||
|
||||
// Regular old hello world
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern fn exit(usize) noreturn;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn exit(usize) noreturn;
|
||||
\\
|
||||
\\pub export fn main() noreturn {
|
||||
\\ print();
|
||||
@ -2137,7 +2137,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
|
||||
|
||||
// Now using start.zig without an explicit extern exit fn
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ print();
|
||||
@ -2154,7 +2154,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
|
||||
|
||||
// Print it 4 times and force growth and realloc.
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ print();
|
||||
@ -2178,7 +2178,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
|
||||
|
||||
// Print it once, and change the message.
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ print();
|
||||
@ -2195,7 +2195,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
|
||||
|
||||
// Now we print it twice.
|
||||
case.addCompareOutput(
|
||||
\\extern fn write(usize, usize, usize) usize;
|
||||
\\extern "c" fn write(usize, usize, usize) usize;
|
||||
\\
|
||||
\\pub fn main() void {
|
||||
\\ print();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user