authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-02-02 16:25:46+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-02-02 16:25:46+01:00
log8f3be0e04f47b250eb84029ff524130b8411daf8
treef7b0e2d5b1513b75bf0c1a56f0a375aa47fd46f6
parent06a037bb9577e42c329a72082b3e44c75d1b2a7d

stage2: update stage2 tests with qualified import lib names for externs

From ```zig extern fn write(...); ``` to ```zig extern "c" fn write(...); ```

2 files changed, 19 insertions(+), 19 deletions(-)

test/stage2/aarch64.zig+6-6
...@@ -121,8 +121,8 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -121,8 +121,8 @@ pub fn addCases(ctx: *TestContext) !void {
121121
122 // Regular old hello world122 // Regular old hello world
123 case.addCompareOutput(123 case.addCompareOutput(
124 \\extern fn write(usize, usize, usize) usize;124 \\extern "c" fn write(usize, usize, usize) usize;
125 \\extern fn exit(usize) noreturn;125 \\extern "c" fn exit(usize) noreturn;
126 \\126 \\
127 \\pub export fn main() noreturn {127 \\pub export fn main() noreturn {
128 \\ print();128 \\ print();
...@@ -141,7 +141,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -141,7 +141,7 @@ pub fn addCases(ctx: *TestContext) !void {
141141
142 // Now using start.zig without an explicit extern exit fn142 // Now using start.zig without an explicit extern exit fn
143 case.addCompareOutput(143 case.addCompareOutput(
144 \\extern fn write(usize, usize, usize) usize;144 \\extern "c" fn write(usize, usize, usize) usize;
145 \\145 \\
146 \\pub fn main() void {146 \\pub fn main() void {
147 \\ print();147 \\ print();
...@@ -158,7 +158,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -158,7 +158,7 @@ pub fn addCases(ctx: *TestContext) !void {
158158
159 // Print it 4 times and force growth and realloc.159 // Print it 4 times and force growth and realloc.
160 case.addCompareOutput(160 case.addCompareOutput(
161 \\extern fn write(usize, usize, usize) usize;161 \\extern "c" fn write(usize, usize, usize) usize;
162 \\162 \\
163 \\pub fn main() void {163 \\pub fn main() void {
164 \\ print();164 \\ print();
...@@ -182,7 +182,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -182,7 +182,7 @@ pub fn addCases(ctx: *TestContext) !void {
182182
183 // Print it once, and change the message.183 // Print it once, and change the message.
184 case.addCompareOutput(184 case.addCompareOutput(
185 \\extern fn write(usize, usize, usize) usize;185 \\extern "c" fn write(usize, usize, usize) usize;
186 \\186 \\
187 \\pub fn main() void {187 \\pub fn main() void {
188 \\ print();188 \\ print();
...@@ -199,7 +199,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -199,7 +199,7 @@ pub fn addCases(ctx: *TestContext) !void {
199199
200 // Now we print it twice.200 // Now we print it twice.
201 case.addCompareOutput(201 case.addCompareOutput(
202 \\extern fn write(usize, usize, usize) usize;202 \\extern "c" fn write(usize, usize, usize) usize;
203 \\203 \\
204 \\pub fn main() void {204 \\pub fn main() void {
205 \\ print();205 \\ print();
test/stage2/x86_64.zig+13-13
...@@ -328,7 +328,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -328,7 +328,7 @@ pub fn addCases(ctx: *TestContext) !void {
328 .macos => {328 .macos => {
329 // While loops329 // While loops
330 case.addCompareOutput(330 case.addCompareOutput(
331 \\extern fn write(usize, usize, usize) usize;331 \\extern "c" fn write(usize, usize, usize) usize;
332 \\332 \\
333 \\pub fn main() void {333 \\pub fn main() void {
334 \\ var i: u32 = 0;334 \\ var i: u32 = 0;
...@@ -349,7 +349,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -349,7 +349,7 @@ pub fn addCases(ctx: *TestContext) !void {
349349
350 // inline while requires the condition to be comptime known.350 // inline while requires the condition to be comptime known.
351 case.addError(351 case.addError(
352 \\extern fn write(usize, usize, usize) usize;352 \\extern "c" fn write(usize, usize, usize) usize;
353 \\353 \\
354 \\pub fn main() void {354 \\pub fn main() void {
355 \\ var i: u32 = 0;355 \\ var i: u32 = 0;
...@@ -652,7 +652,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -652,7 +652,7 @@ pub fn addCases(ctx: *TestContext) !void {
652 .macos => {652 .macos => {
653 // Basic for loop653 // Basic for loop
654 case.addCompareOutput(654 case.addCompareOutput(
655 \\extern fn write(usize, usize, usize) usize;655 \\extern "c" fn write(usize, usize, usize) usize;
656 \\656 \\
657 \\pub fn main() void {657 \\pub fn main() void {
658 \\ for ("hello") |_| print();658 \\ for ("hello") |_| print();
...@@ -736,7 +736,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -736,7 +736,7 @@ pub fn addCases(ctx: *TestContext) !void {
736 }),736 }),
737 .macos => try case.files.append(.{737 .macos => try case.files.append(.{
738 .src = 738 .src =
739 \\extern fn write(usize, usize, usize) usize;739 \\extern "c" fn write(usize, usize, usize) usize;
740 \\740 \\
741 \\pub fn print() void {741 \\pub fn print() void {
742 \\ _ = write(1, @ptrToInt("Hello, World!\n"), 14);742 \\ _ = write(1, @ptrToInt("Hello, World!\n"), 14);
...@@ -814,7 +814,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -814,7 +814,7 @@ pub fn addCases(ctx: *TestContext) !void {
814 }),814 }),
815 .macos => try case.files.append(.{815 .macos => try case.files.append(.{
816 .src = 816 .src =
817 \\extern fn write(usize, usize, usize) usize;817 \\extern "c" fn write(usize, usize, usize) usize;
818 \\fn print() void {818 \\fn print() void {
819 \\ _ = write(1, @ptrToInt("Hello, World!\n"), 14);819 \\ _ = write(1, @ptrToInt("Hello, World!\n"), 14);
820 \\}820 \\}
...@@ -1478,7 +1478,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -1478,7 +1478,7 @@ pub fn addCases(ctx: *TestContext) !void {
1478 \\}1478 \\}
1479 , "HelloHello, World!\n"),1479 , "HelloHello, World!\n"),
1480 .macos => case.addCompareOutput(1480 .macos => case.addCompareOutput(
1481 \\extern fn write(usize, usize, usize) usize;1481 \\extern "c" fn write(usize, usize, usize) usize;
1482 \\1482 \\
1483 \\pub fn main() void {1483 \\pub fn main() void {
1484 \\ comptime var len: u32 = 5;1484 \\ comptime var len: u32 = 5;
...@@ -1550,7 +1550,7 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -1550,7 +1550,7 @@ pub fn addCases(ctx: *TestContext) !void {
1550 \\}1550 \\}
1551 , "HeHelHellHello"),1551 , "HeHelHellHello"),
1552 .macos => case.addCompareOutput(1552 .macos => case.addCompareOutput(
1553 \\extern fn write(usize, usize, usize) usize;1553 \\extern "c" fn write(usize, usize, usize) usize;
1554 \\1554 \\
1555 \\pub fn main() void {1555 \\pub fn main() void {
1556 \\ comptime var i: u64 = 2;1556 \\ comptime var i: u64 = 2;
...@@ -2117,8 +2117,8 @@ fn addMacOsTestCases(ctx: *TestContext) !void {...@@ -2117,8 +2117,8 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
21172117
2118 // Regular old hello world2118 // Regular old hello world
2119 case.addCompareOutput(2119 case.addCompareOutput(
2120 \\extern fn write(usize, usize, usize) usize;2120 \\extern "c" fn write(usize, usize, usize) usize;
2121 \\extern fn exit(usize) noreturn;2121 \\extern "c" fn exit(usize) noreturn;
2122 \\2122 \\
2123 \\pub export fn main() noreturn {2123 \\pub export fn main() noreturn {
2124 \\ print();2124 \\ print();
...@@ -2137,7 +2137,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {...@@ -2137,7 +2137,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
21372137
2138 // Now using start.zig without an explicit extern exit fn2138 // Now using start.zig without an explicit extern exit fn
2139 case.addCompareOutput(2139 case.addCompareOutput(
2140 \\extern fn write(usize, usize, usize) usize;2140 \\extern "c" fn write(usize, usize, usize) usize;
2141 \\2141 \\
2142 \\pub fn main() void {2142 \\pub fn main() void {
2143 \\ print();2143 \\ print();
...@@ -2154,7 +2154,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {...@@ -2154,7 +2154,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
21542154
2155 // Print it 4 times and force growth and realloc.2155 // Print it 4 times and force growth and realloc.
2156 case.addCompareOutput(2156 case.addCompareOutput(
2157 \\extern fn write(usize, usize, usize) usize;2157 \\extern "c" fn write(usize, usize, usize) usize;
2158 \\2158 \\
2159 \\pub fn main() void {2159 \\pub fn main() void {
2160 \\ print();2160 \\ print();
...@@ -2178,7 +2178,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {...@@ -2178,7 +2178,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
21782178
2179 // Print it once, and change the message.2179 // Print it once, and change the message.
2180 case.addCompareOutput(2180 case.addCompareOutput(
2181 \\extern fn write(usize, usize, usize) usize;2181 \\extern "c" fn write(usize, usize, usize) usize;
2182 \\2182 \\
2183 \\pub fn main() void {2183 \\pub fn main() void {
2184 \\ print();2184 \\ print();
...@@ -2195,7 +2195,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {...@@ -2195,7 +2195,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
21952195
2196 // Now we print it twice.2196 // Now we print it twice.
2197 case.addCompareOutput(2197 case.addCompareOutput(
2198 \\extern fn write(usize, usize, usize) usize;2198 \\extern "c" fn write(usize, usize, usize) usize;
2199 \\2199 \\
2200 \\pub fn main() void {2200 \\pub fn main() void {
2201 \\ print();2201 \\ print();