| ... | ... | @@ -410,7 +410,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 410 | 410 | \\ .Fn = .{ |
| 411 | 411 | \\ .calling_convention = .Unspecified, |
| 412 | 412 | \\ .alignment = 0, |
| 413 | | \\ .address_space = 0, |
| 413 | \\ .address_space = .generic, |
| 414 | 414 | \\ .is_generic = true, |
| 415 | 415 | \\ .is_var_args = false, |
| 416 | 416 | \\ .return_type = u0, |
| ... | ... | @@ -427,7 +427,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 427 | 427 | \\ .Fn = .{ |
| 428 | 428 | \\ .calling_convention = .Unspecified, |
| 429 | 429 | \\ .alignment = 0, |
| 430 | | \\ .address_space = 0, |
| 430 | \\ .address_space = .generic, |
| 431 | 431 | \\ .is_generic = false, |
| 432 | 432 | \\ .is_var_args = true, |
| 433 | 433 | \\ .return_type = u0, |
| ... | ... | @@ -444,7 +444,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 444 | 444 | \\ .Fn = .{ |
| 445 | 445 | \\ .calling_convention = .Unspecified, |
| 446 | 446 | \\ .alignment = 0, |
| 447 | | \\ .address_space = 0, |
| 447 | \\ .address_space = .generic, |
| 448 | 448 | \\ .is_generic = false, |
| 449 | 449 | \\ .is_var_args = false, |
| 450 | 450 | \\ .return_type = null, |
| ... | ... | @@ -456,6 +456,23 @@ pub fn addCases(ctx: *TestContext) !void { |
| 456 | 456 | "tmp.zig:1:20: error: TypeInfo.Fn.return_type must be non-null for @Type", |
| 457 | 457 | }); |
| 458 | 458 | |
| 459 | ctx.objErrStage1("@Type(.Fn) with invalid address space ", |
| 460 | \\const Foo = @Type(.{ |
| 461 | \\ .Fn = .{ |
| 462 | \\ .calling_convention = .Unspecified, |
| 463 | \\ .alignment = 0, |
| 464 | \\ .address_space = .fs, |
| 465 | \\ .is_generic = false, |
| 466 | \\ .is_var_args = false, |
| 467 | \\ .return_type = u0, |
| 468 | \\ .args = &[_]@import("std").builtin.TypeInfo.FnArg{}, |
| 469 | \\ }, |
| 470 | \\}); |
| 471 | \\comptime { _ = Foo; } |
| 472 | , &[_][]const u8{ |
| 473 | "tmp.zig:1:20: error: address space 'fs' not available in stage 1 compiler, must be .generic", |
| 474 | }); |
| 475 | |
| 459 | 476 | ctx.objErrStage1("@Type for union with opaque field", |
| 460 | 477 | \\const TypeInfo = @import("std").builtin.TypeInfo; |
| 461 | 478 | \\const Untagged = @Type(.{ |
| ... | ... | @@ -724,6 +741,23 @@ pub fn addCases(ctx: *TestContext) !void { |
| 724 | 741 | "tmp.zig:2:16: error: sentinels are only allowed on slices and unknown-length pointers", |
| 725 | 742 | }); |
| 726 | 743 | |
| 744 | ctx.objErrStage1("@Type(.Pointer) with invalid address space ", |
| 745 | \\export fn entry() void { |
| 746 | \\ _ = @Type(.{ .Pointer = .{ |
| 747 | \\ .size = .One, |
| 748 | \\ .is_const = false, |
| 749 | \\ .is_volatile = false, |
| 750 | \\ .alignment = 1, |
| 751 | \\ .address_space = .gs, |
| 752 | \\ .child = u8, |
| 753 | \\ .is_allowzero = false, |
| 754 | \\ .sentinel = null, |
| 755 | \\ }}); |
| 756 | \\} |
| 757 | , &[_][]const u8{ |
| 758 | "tmp.zig:2:16: error: address space 'gs' not available in stage 1 compiler, must be .generic", |
| 759 | }); |
| 760 | |
| 727 | 761 | ctx.testErrStage1("helpful return type error message", |
| 728 | 762 | \\export fn foo() u32 { |
| 729 | 763 | \\ return error.Ohno; |