| ... | @@ -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\n | 151 | \\ // 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\n | 330 | \\ // 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 { |