authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-04-28 12:11:49+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-04-28 18:35:01+02:00
logc8d0fb0b212f2c618321caeeac315c1792b06035
tree20acc69efe574781e49a79566b9a081763449299
parent3c19f694d92c5a3d7f6e3a6d857252406df0d6e3

test: migrate stage2 independent compile errors to test manifest parser


14 files changed, 18 insertions(+), 18 deletions(-)

src/test.zig+3-3
......@@ -42,12 +42,12 @@ test {
4242 defer compile_errors_dir.close();
4343
4444 {
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();
4747
4848 // TODO make this incremental once the bug is solved that it triggers
4949 // See: https://github.com/ziglang/zig/issues/11344
50 ctx.addErrorCasesFromDir("stage2", stage2_dir, .stage2, .Obj, false, .independent);
50 ctx.addTestCasesFromDir(dir, .independent);
5151 }
5252
5353 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 {
1414 _ = allocator;
1515}
1616
17// constant inside comptime function has compile error
17// error
1818//
1919// :4:5: error: unreachable code
2020// :4:25: note: control flow is diverted here
test/compile_errors/stage2/duplicate-unused_labels.zig+1-1
......@@ -17,7 +17,7 @@ comptime {
1717 blk: for(@as([0]void, undefined)) |_| {}
1818}
1919
20// duplicate/unused labels
20// error
2121//
2222// :2:12: error: redefinition of label 'blk'
2323// :2:5: note: previous definition here
test/compile_errors/stage2/embed_outside_package.zig+1-1
......@@ -2,6 +2,6 @@ export fn a() usize {
22 return @embedFile("/root/foo").len;
33}
44
5// embed outside package
5// error
66//
77//: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 {
22 return @import("../../above.zig").len;
33}
44
5// import outside package
5// error
66//
77// :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 {
2020 _ = slice;
2121}
2222
23// out of bounds indexing
23// error
2424//
2525// :4:26: error: end index 6 out of bounds for slice of length 4 +1 (sentinel)
2626// :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 {
55 _ = y;
66}
77
8// slice of null C pointer
8// error
99//
1010// :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 {
88 _ = s;
99}
1010
11// duplicate struct field name
11// error
1212//
1313// :3:5: error: duplicate struct field: 'foo'
1414// :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 {
33 b: u64,
44};
55comptime {
6 var u: U = .{.a = {}};
6 var u: U = .{ .a = {} };
77 const v = u.b;
88 _ = v;
99}
1010
11// access of inactive union field
11// error
1212//
1313// :7:16: error: access of union field 'b' while field 'a' is active
1414// :1:11: note: union declared here
test/compile_errors/stage2/union_duplicate_enum_field.zig+2-2
......@@ -1,4 +1,4 @@
1const E = enum {a, b};
1const E = enum { a, b };
22const U = union(E) {
33 a: u32,
44 a: u32,
......@@ -9,7 +9,7 @@ export fn foo() void {
99 _ = u;
1010}
1111
12// union with enum and duplicate fields
12// error
1313//
1414// :4:5: error: duplicate union field: 'a'
1515// :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 {
88 _ = u;
99}
1010
11// duplicate union field name
11// error
1212//
1313// :3:5: error: duplicate union field: 'foo'
1414// :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 {
1313 return @sizeOf(U);
1414}
1515
16// enum field missing in union
16// error
1717//
1818// :7:1: error: enum field(s) missing in union
1919// :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 {
1313 return @sizeOf(U);
1414}
1515
16// union extra field
16// error
1717//
1818// :6:1: error: enum 'tmp.E' has no field named 'd'
1919// :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 {
1414 return u.b;
1515}
1616
17// runtime coercion from enum to union
17// error
1818//
1919// :13:19: error: runtime coercion from enum 'tmp.E' to union 'tmp.U' which has non-void fields
2020// :6:5: note: field 'a' has type 'u32'