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 {
121121
122122 // Regular old hello world
123123 case.addCompareOutput(
124 \\extern fn write(usize, usize, usize) usize;
125 \\extern fn exit(usize) noreturn;
124 \\extern "c" fn write(usize, usize, usize) usize;
125 \\extern "c" fn exit(usize) noreturn;
126126 \\
127127 \\pub export fn main() noreturn {
128128 \\ print();
......@@ -141,7 +141,7 @@ pub fn addCases(ctx: *TestContext) !void {
141141
142142 // Now using start.zig without an explicit extern exit fn
143143 case.addCompareOutput(
144 \\extern fn write(usize, usize, usize) usize;
144 \\extern "c" fn write(usize, usize, usize) usize;
145145 \\
146146 \\pub fn main() void {
147147 \\ print();
......@@ -158,7 +158,7 @@ pub fn addCases(ctx: *TestContext) !void {
158158
159159 // Print it 4 times and force growth and realloc.
160160 case.addCompareOutput(
161 \\extern fn write(usize, usize, usize) usize;
161 \\extern "c" fn write(usize, usize, usize) usize;
162162 \\
163163 \\pub fn main() void {
164164 \\ print();
......@@ -182,7 +182,7 @@ pub fn addCases(ctx: *TestContext) !void {
182182
183183 // Print it once, and change the message.
184184 case.addCompareOutput(
185 \\extern fn write(usize, usize, usize) usize;
185 \\extern "c" fn write(usize, usize, usize) usize;
186186 \\
187187 \\pub fn main() void {
188188 \\ print();
......@@ -199,7 +199,7 @@ pub fn addCases(ctx: *TestContext) !void {
199199
200200 // Now we print it twice.
201201 case.addCompareOutput(
202 \\extern fn write(usize, usize, usize) usize;
202 \\extern "c" fn write(usize, usize, usize) usize;
203203 \\
204204 \\pub fn main() void {
205205 \\ print();
test/stage2/x86_64.zig+13-13
......@@ -328,7 +328,7 @@ pub fn addCases(ctx: *TestContext) !void {
328328 .macos => {
329329 // While loops
330330 case.addCompareOutput(
331 \\extern fn write(usize, usize, usize) usize;
331 \\extern "c" fn write(usize, usize, usize) usize;
332332 \\
333333 \\pub fn main() void {
334334 \\ var i: u32 = 0;
......@@ -349,7 +349,7 @@ pub fn addCases(ctx: *TestContext) !void {
349349
350350 // inline while requires the condition to be comptime known.
351351 case.addError(
352 \\extern fn write(usize, usize, usize) usize;
352 \\extern "c" fn write(usize, usize, usize) usize;
353353 \\
354354 \\pub fn main() void {
355355 \\ var i: u32 = 0;
......@@ -652,7 +652,7 @@ pub fn addCases(ctx: *TestContext) !void {
652652 .macos => {
653653 // Basic for loop
654654 case.addCompareOutput(
655 \\extern fn write(usize, usize, usize) usize;
655 \\extern "c" fn write(usize, usize, usize) usize;
656656 \\
657657 \\pub fn main() void {
658658 \\ for ("hello") |_| print();
......@@ -736,7 +736,7 @@ pub fn addCases(ctx: *TestContext) !void {
736736 }),
737737 .macos => try case.files.append(.{
738738 .src =
739 \\extern fn write(usize, usize, usize) usize;
739 \\extern "c" fn write(usize, usize, usize) usize;
740740 \\
741741 \\pub fn print() void {
742742 \\ _ = write(1, @ptrToInt("Hello, World!\n"), 14);
......@@ -814,7 +814,7 @@ pub fn addCases(ctx: *TestContext) !void {
814814 }),
815815 .macos => try case.files.append(.{
816816 .src =
817 \\extern fn write(usize, usize, usize) usize;
817 \\extern "c" fn write(usize, usize, usize) usize;
818818 \\fn print() void {
819819 \\ _ = write(1, @ptrToInt("Hello, World!\n"), 14);
820820 \\}
......@@ -1478,7 +1478,7 @@ pub fn addCases(ctx: *TestContext) !void {
14781478 \\}
14791479 , "HelloHello, World!\n"),
14801480 .macos => case.addCompareOutput(
1481 \\extern fn write(usize, usize, usize) usize;
1481 \\extern "c" fn write(usize, usize, usize) usize;
14821482 \\
14831483 \\pub fn main() void {
14841484 \\ comptime var len: u32 = 5;
......@@ -1550,7 +1550,7 @@ pub fn addCases(ctx: *TestContext) !void {
15501550 \\}
15511551 , "HeHelHellHello"),
15521552 .macos => case.addCompareOutput(
1553 \\extern fn write(usize, usize, usize) usize;
1553 \\extern "c" fn write(usize, usize, usize) usize;
15541554 \\
15551555 \\pub fn main() void {
15561556 \\ comptime var i: u64 = 2;
......@@ -2117,8 +2117,8 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
21172117
21182118 // Regular old hello world
21192119 case.addCompareOutput(
2120 \\extern fn write(usize, usize, usize) usize;
2121 \\extern fn exit(usize) noreturn;
2120 \\extern "c" fn write(usize, usize, usize) usize;
2121 \\extern "c" fn exit(usize) noreturn;
21222122 \\
21232123 \\pub export fn main() noreturn {
21242124 \\ print();
......@@ -2137,7 +2137,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
21372137
21382138 // Now using start.zig without an explicit extern exit fn
21392139 case.addCompareOutput(
2140 \\extern fn write(usize, usize, usize) usize;
2140 \\extern "c" fn write(usize, usize, usize) usize;
21412141 \\
21422142 \\pub fn main() void {
21432143 \\ print();
......@@ -2154,7 +2154,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
21542154
21552155 // Print it 4 times and force growth and realloc.
21562156 case.addCompareOutput(
2157 \\extern fn write(usize, usize, usize) usize;
2157 \\extern "c" fn write(usize, usize, usize) usize;
21582158 \\
21592159 \\pub fn main() void {
21602160 \\ print();
......@@ -2178,7 +2178,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
21782178
21792179 // Print it once, and change the message.
21802180 case.addCompareOutput(
2181 \\extern fn write(usize, usize, usize) usize;
2181 \\extern "c" fn write(usize, usize, usize) usize;
21822182 \\
21832183 \\pub fn main() void {
21842184 \\ print();
......@@ -2195,7 +2195,7 @@ fn addMacOsTestCases(ctx: *TestContext) !void {
21952195
21962196 // Now we print it twice.
21972197 case.addCompareOutput(
2198 \\extern fn write(usize, usize, usize) usize;
2198 \\extern "c" fn write(usize, usize, usize) usize;
21992199 \\
22002200 \\pub fn main() void {
22012201 \\ print();