| author | |
| committer | |
| log | c8d0fb0b212f2c618321caeeac315c1792b06035 |
| tree | 20acc69efe574781e49a79566b9a081763449299 |
| parent | 3c19f694d92c5a3d7f6e3a6d857252406df0d6e3 |
14 files changed, 18 insertions(+), 18 deletions(-)
src/test.zig+3-3| ... | ... | @@ -42,12 +42,12 @@ test { |
| 42 | 42 | defer compile_errors_dir.close(); |
| 43 | 43 | |
| 44 | 44 | { |
| 45 | var stage2_dir = try compile_errors_dir.openDir("stage2", .{ .iterate = true }); | |
| 46 | defer stage2_dir.close(); | |
| 45 | var dir = try compile_errors_dir.openDir("stage2", .{ .iterate = true }); | |
| 46 | defer dir.close(); | |
| 47 | 47 | |
| 48 | 48 | // TODO make this incremental once the bug is solved that it triggers |
| 49 | 49 | // See: https://github.com/ziglang/zig/issues/11344 |
| 50 | ctx.addErrorCasesFromDir("stage2", stage2_dir, .stage2, .Obj, false, .independent); | |
| 50 | ctx.addTestCasesFromDir(dir, .independent); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if (!skip_stage1) { |
test/compile_errors/stage2/constant_inside_comptime_function_has_compile_error.zig+1-1| ... | ... | @@ -14,7 +14,7 @@ export fn entry() void { |
| 14 | 14 | _ = allocator; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | // constant inside comptime function has compile error | |
| 17 | // error | |
| 18 | 18 | // |
| 19 | 19 | // :4:5: error: unreachable code |
| 20 | 20 | // :4:25: note: control flow is diverted here |
test/compile_errors/stage2/duplicate-unused_labels.zig+1-1| ... | ... | @@ -17,7 +17,7 @@ comptime { |
| 17 | 17 | blk: for(@as([0]void, undefined)) |_| {} |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | // duplicate/unused labels | |
| 20 | // error | |
| 21 | 21 | // |
| 22 | 22 | // :2:12: error: redefinition of label 'blk' |
| 23 | 23 | // :2:5: note: previous definition here |
test/compile_errors/stage2/embed_outside_package.zig+1-1| ... | ... | @@ -2,6 +2,6 @@ export fn a() usize { |
| 2 | 2 | return @embedFile("/root/foo").len; |
| 3 | 3 | } |
| 4 | 4 | |
| 5 | // embed outside package | |
| 5 | // error | |
| 6 | 6 | // |
| 7 | 7 | //:2:23: error: embed of file outside package path: '/root/foo' |
test/compile_errors/stage2/import_outside_package.zig+1-1| ... | ... | @@ -2,6 +2,6 @@ export fn a() usize { |
| 2 | 2 | return @import("../../above.zig").len; |
| 3 | 3 | } |
| 4 | 4 | |
| 5 | // import outside package | |
| 5 | // error | |
| 6 | 6 | // |
| 7 | 7 | // :2:20: error: import of file outside package path: '../../above.zig' |
test/compile_errors/stage2/out_of_bounds_index.zig+1-1| ... | ... | @@ -20,7 +20,7 @@ comptime { |
| 20 | 20 | _ = slice; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | // out of bounds indexing | |
| 23 | // error | |
| 24 | 24 | // |
| 25 | 25 | // :4:26: error: end index 6 out of bounds for slice of length 4 +1 (sentinel) |
| 26 | 26 | // :9:22: error: end index 6 out of bounds for array of length 4 +1 (sentinel) |
test/compile_errors/stage2/slice_of_null_pointer.zig+1-1| ... | ... | @@ -5,6 +5,6 @@ comptime { |
| 5 | 5 | _ = y; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | // slice of null C pointer | |
| 8 | // error | |
| 9 | 9 | // |
| 10 | 10 | // :4:14: error: slice of null pointer |
test/compile_errors/stage2/struct_duplicate_field_name.zig+1-1| ... | ... | @@ -8,7 +8,7 @@ export fn entry() void { |
| 8 | 8 | _ = s; |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | // duplicate struct field name | |
| 11 | // error | |
| 12 | 12 | // |
| 13 | 13 | // :3:5: error: duplicate struct field: 'foo' |
| 14 | 14 | // :2:5: note: other field here |
test/compile_errors/stage2/union_access_of_inactive_field.zig+2-2| ... | ... | @@ -3,12 +3,12 @@ const U = union { |
| 3 | 3 | b: u64, |
| 4 | 4 | }; |
| 5 | 5 | comptime { |
| 6 | var u: U = .{.a = {}}; | |
| 6 | var u: U = .{ .a = {} }; | |
| 7 | 7 | const v = u.b; |
| 8 | 8 | _ = v; |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | // access of inactive union field | |
| 11 | // error | |
| 12 | 12 | // |
| 13 | 13 | // :7:16: error: access of union field 'b' while field 'a' is active |
| 14 | 14 | // :1:11: note: union declared here |
test/compile_errors/stage2/union_duplicate_enum_field.zig+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | const E = enum {a, b}; | |
| 1 | const E = enum { a, b }; | |
| 2 | 2 | const U = union(E) { |
| 3 | 3 | a: u32, |
| 4 | 4 | a: u32, |
| ... | ... | @@ -9,7 +9,7 @@ export fn foo() void { |
| 9 | 9 | _ = u; |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | // union with enum and duplicate fields | |
| 12 | // error | |
| 13 | 13 | // |
| 14 | 14 | // :4:5: error: duplicate union field: 'a' |
| 15 | 15 | // :3:5: note: other field here |
test/compile_errors/stage2/union_duplicate_field_definition.zig+1-1| ... | ... | @@ -8,7 +8,7 @@ export fn entry() void { |
| 8 | 8 | _ = u; |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | // duplicate union field name | |
| 11 | // error | |
| 12 | 12 | // |
| 13 | 13 | // :3:5: error: duplicate union field: 'foo' |
| 14 | 14 | // :2:5: note: other field here |
test/compile_errors/stage2/union_enum_field_missing.zig+1-1| ... | ... | @@ -13,7 +13,7 @@ export fn entry() usize { |
| 13 | 13 | return @sizeOf(U); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | // enum field missing in union | |
| 16 | // error | |
| 17 | 17 | // |
| 18 | 18 | // :7:1: error: enum field(s) missing in union |
| 19 | 19 | // :4:5: note: field 'c' missing, declared here |
test/compile_errors/stage2/union_extra_field.zig+1-1| ... | ... | @@ -13,7 +13,7 @@ export fn entry() usize { |
| 13 | 13 | return @sizeOf(U); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | // union extra field | |
| 16 | // error | |
| 17 | 17 | // |
| 18 | 18 | // :6:1: error: enum 'tmp.E' has no field named 'd' |
| 19 | 19 | // :1:11: note: enum declared here |
test/compile_errors/stage2/union_runtime_coercion_from_enum.zig+1-1| ... | ... | @@ -14,7 +14,7 @@ export fn doTheTest() u64 { |
| 14 | 14 | return u.b; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | // runtime coercion from enum to union | |
| 17 | // error | |
| 18 | 18 | // |
| 19 | 19 | // :13:19: error: runtime coercion from enum 'tmp.E' to union 'tmp.U' which has non-void fields |
| 20 | 20 | // :6:5: note: field 'a' has type 'u32' |