authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-22 16:26:56-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-23 10:44:46-07:00
log189fc964f749eeb83f184fa497438cb06e0008a0
treea09d639641cd9b1abdfd2e1a6837fbc35e8a6337
parentaf40e3f54c12857bb5ac541f8a3e1a9b5f93a626

fix unused parameters in compare_output test cases


1 files changed, 16 insertions(+), 2 deletions(-)

test/compare_output.zig+16-2
...@@ -10,6 +10,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {...@@ -10,6 +10,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
10 \\ @cInclude("stdio.h");10 \\ @cInclude("stdio.h");
11 \\});11 \\});
12 \\pub export fn main(argc: c_int, argv: [*][*]u8) c_int {12 \\pub export fn main(argc: c_int, argv: [*][*]u8) c_int {
13 \\ _ = argc;
14 \\ _ = argv;
13 \\ _ = c.puts("Hello, world!");15 \\ _ = c.puts("Hello, world!");
14 \\ return 0;16 \\ return 0;
15 \\}17 \\}
...@@ -143,6 +145,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {...@@ -143,6 +145,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
143 \\});145 \\});
144 \\146 \\
145 \\pub export fn main(argc: c_int, argv: [*][*]u8) c_int {147 \\pub export fn main(argc: c_int, argv: [*][*]u8) c_int {
148 \\ _ = argc;
149 \\ _ = argv;
146 \\ if (is_windows) {150 \\ if (is_windows) {
147 \\ // we want actual \n, not \r\n151 \\ // we want actual \n, not \r\n
148 \\ _ = c._setmode(1, c._O_BINARY);152 \\ _ = c._setmode(1, c._O_BINARY);
...@@ -265,8 +269,10 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {...@@ -265,8 +269,10 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
265 \\const y : u16 = 5678;269 \\const y : u16 = 5678;
266 \\pub fn main() void {270 \\pub fn main() void {
267 \\ var x_local : i32 = print_ok(x);271 \\ var x_local : i32 = print_ok(x);
272 \\ _ = x_local;
268 \\}273 \\}
269 \\fn print_ok(val: @TypeOf(x)) @TypeOf(foo) {274 \\fn print_ok(val: @TypeOf(x)) @TypeOf(foo) {
275 \\ _ = val;
270 \\ const stdout = io.getStdOut().writer();276 \\ const stdout = io.getStdOut().writer();
271 \\ stdout.print("OK\n", .{}) catch unreachable;277 \\ stdout.print("OK\n", .{}) catch unreachable;
272 \\ return 0;278 \\ return 0;
...@@ -318,6 +324,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {...@@ -318,6 +324,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
318 \\});324 \\});
319 \\325 \\
320 \\pub export fn main(argc: c_int, argv: [*][*]u8) c_int {326 \\pub export fn main(argc: c_int, argv: [*][*]u8) c_int {
327 \\ _ = argc;
328 \\ _ = argv;
321 \\ if (is_windows) {329 \\ if (is_windows) {
322 \\ // we want actual \n, not \r\n330 \\ // we want actual \n, not \r\n
323 \\ _ = c._setmode(1, c._O_BINARY);331 \\ _ = c._setmode(1, c._O_BINARY);
...@@ -337,13 +345,19 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {...@@ -337,13 +345,19 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
337 \\const Foo = struct {345 \\const Foo = struct {
338 \\ field1: Bar,346 \\ field1: Bar,
339 \\347 \\
340 \\ fn method(a: *const Foo) bool { return true; }348 \\ fn method(a: *const Foo) bool {
349 \\ _ = a;
350 \\ return true;
351 \\ }
341 \\};352 \\};
342 \\353 \\
343 \\const Bar = struct {354 \\const Bar = struct {
344 \\ field2: i32,355 \\ field2: i32,
345 \\356 \\
346 \\ fn method(b: *const Bar) bool { return true; }357 \\ fn method(b: *const Bar) bool {
358 \\ _ = b;
359 \\ return true;
360 \\ }
347 \\};361 \\};
348 \\362 \\
349 \\pub fn main() void {363 \\pub fn main() void {