| author | |
| committer | |
| log | 653c0bae0c473c52716dad35ec8f7f9511114a56 |
| tree | c10e923912ff3314e387c39b87dbc0dfd59b103a |
| parent | f8dcd3477541aabf3bfb05a1d2c51fa3797c0b48 |
12 files changed, 0 insertions(+), 172 deletions(-)
test/cases/compile_errors/stage1/attempt_to_use_0_bit_type_in_extern_fn.zig deleted-17| ... | ... | @@ -1,17 +0,0 @@ |
| 1 | extern fn foo(ptr: fn(*void) callconv(.C) void) void; | |
| 2 | ||
| 3 | export fn entry() void { | |
| 4 | foo(bar); | |
| 5 | } | |
| 6 | ||
| 7 | fn bar(x: *void) callconv(.C) void { _ = x; } | |
| 8 | export fn entry2() void { | |
| 9 | bar(&{}); | |
| 10 | } | |
| 11 | ||
| 12 | // error | |
| 13 | // backend=stage1 | |
| 14 | // target=native | |
| 15 | // | |
| 16 | // tmp.zig:1:23: error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'C' | |
| 17 | // tmp.zig:7:11: error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'C' |
test/cases/compile_errors/stage1/comptime_ptrcast_of_zero-sized_type.zig deleted-12| ... | ... | @@ -1,12 +0,0 @@ |
| 1 | fn foo() void { | |
| 2 | const node: struct {} = undefined; | |
| 3 | const vla_ptr = @ptrCast([*]const u8, &node); | |
| 4 | _ = vla_ptr; | |
| 5 | } | |
| 6 | comptime { foo(); } | |
| 7 | ||
| 8 | // error | |
| 9 | // backend=stage1 | |
| 10 | // target=native | |
| 11 | // | |
| 12 | // tmp.zig:3:21: error: '*const struct:2:17' and '[*]const u8' do not have the same in-memory representation |
test/cases/compile_errors/stage1/error_equality_but_sets_have_no_common_members.zig deleted-16| ... | ... | @@ -1,16 +0,0 @@ |
| 1 | const Set1 = error{A, C}; | |
| 2 | const Set2 = error{B, D}; | |
| 3 | export fn entry() void { | |
| 4 | foo(Set1.A); | |
| 5 | } | |
| 6 | fn foo(x: Set1) void { | |
| 7 | if (x == Set2.B) { | |
| 8 | ||
| 9 | } | |
| 10 | } | |
| 11 | ||
| 12 | // error | |
| 13 | // backend=stage1 | |
| 14 | // target=native | |
| 15 | // | |
| 16 | // tmp.zig:7:11: error: error sets 'Set1' and 'Set2' have no common errors |
test/cases/compile_errors/stage1/implicit_casting_undefined_c_pointer_to_zig_pointer.zig deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | comptime { | |
| 2 | var c_ptr: [*c]u8 = undefined; | |
| 3 | var zig_ptr: *u8 = c_ptr; | |
| 4 | _ = zig_ptr; | |
| 5 | } | |
| 6 | ||
| 7 | // error | |
| 8 | // backend=stage1 | |
| 9 | // target=native | |
| 10 | // | |
| 11 | // tmp.zig:3:24: error: use of undefined value here causes undefined behavior |
test/cases/compile_errors/stage1/issue_2687_coerce_from_undefined_array_pointer_to_slice.zig deleted-27| ... | ... | @@ -1,27 +0,0 @@ |
| 1 | export fn foo1() void { | |
| 2 | const a: *[1]u8 = undefined; | |
| 3 | var b: []u8 = a; | |
| 4 | _ = b; | |
| 5 | } | |
| 6 | export fn foo2() void { | |
| 7 | comptime { | |
| 8 | var a: *[1]u8 = undefined; | |
| 9 | var b: []u8 = a; | |
| 10 | _ = b; | |
| 11 | } | |
| 12 | } | |
| 13 | export fn foo3() void { | |
| 14 | comptime { | |
| 15 | const a: *[1]u8 = undefined; | |
| 16 | var b: []u8 = a; | |
| 17 | _ = b; | |
| 18 | } | |
| 19 | } | |
| 20 | ||
| 21 | // error | |
| 22 | // backend=stage1 | |
| 23 | // target=native | |
| 24 | // | |
| 25 | // tmp.zig:3:19: error: use of undefined value here causes undefined behavior | |
| 26 | // tmp.zig:9:23: error: use of undefined value here causes undefined behavior | |
| 27 | // tmp.zig:16:23: error: use of undefined value here causes undefined behavior |
test/cases/compile_errors/stage1/ptrToInt_on_void.zig deleted-9| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | export fn entry() bool { | |
| 2 | return @ptrToInt(&{}) == @ptrToInt(&{}); | |
| 3 | } | |
| 4 | ||
| 5 | // error | |
| 6 | // backend=stage1 | |
| 7 | // target=native | |
| 8 | // | |
| 9 | // tmp.zig:2:23: error: pointer to size 0 type has no address |
test/cases/compile_errors/stage1/ptrToInt_with_pointer_to_zero-sized_type.zig deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | export fn entry() void { | |
| 2 | var pointer: ?*u0 = null; | |
| 3 | var x = @ptrToInt(pointer); | |
| 4 | _ = x; | |
| 5 | } | |
| 6 | ||
| 7 | // error | |
| 8 | // backend=stage1 | |
| 9 | // target=native | |
| 10 | // | |
| 11 | // tmp.zig:3:23: error: pointer to size 0 type has no address |
test/cases/compile_errors/stage1/reify_type.Pointer_with_invalid_address_space.zig deleted-18| ... | ... | @@ -1,18 +0,0 @@ |
| 1 | export fn entry() void { | |
| 2 | _ = @Type(.{ .Pointer = .{ | |
| 3 | .size = .One, | |
| 4 | .is_const = false, | |
| 5 | .is_volatile = false, | |
| 6 | .alignment = 1, | |
| 7 | .address_space = .gs, | |
| 8 | .child = u8, | |
| 9 | .is_allowzero = false, | |
| 10 | .sentinel = null, | |
| 11 | }}); | |
| 12 | } | |
| 13 | ||
| 14 | // error | |
| 15 | // backend=stage1 | |
| 16 | // target=native | |
| 17 | // | |
| 18 | // tmp.zig:2:16: error: address space 'gs' not available in stage 1 compiler, must be .generic |
test/cases/compile_errors/stage1/reify_type_with_non-constant_expression.zig deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | const builtin = @import("std").builtin; | |
| 2 | var globalTypeInfo : builtin.Type = undefined; | |
| 3 | export fn entry() void { | |
| 4 | _ = @Type(globalTypeInfo); | |
| 5 | } | |
| 6 | ||
| 7 | // error | |
| 8 | // backend=stage1 | |
| 9 | // target=native | |
| 10 | // | |
| 11 | // tmp.zig:4:15: error: unable to evaluate constant expression |
test/cases/compile_errors/stage1/slicing_of_global_undefined_pointer.zig deleted-10| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | var buf: *[1]u8 = undefined; | |
| 2 | export fn entry() void { | |
| 3 | _ = buf[0..1]; | |
| 4 | } | |
| 5 | ||
| 6 | // error | |
| 7 | // backend=stage1 | |
| 8 | // target=native | |
| 9 | // | |
| 10 | // tmp.zig:3:12: error: non-zero length slice of undefined pointer |
test/cases/compile_errors/stage1/switch_with_invalid_expression_parameter.zig deleted-17| ... | ... | @@ -1,17 +0,0 @@ |
| 1 | export fn entry() void { | |
| 2 | Test(i32); | |
| 3 | } | |
| 4 | fn Test(comptime T: type) void { | |
| 5 | const x = switch (T) { | |
| 6 | []u8 => |x| x, | |
| 7 | i32 => |x| x, | |
| 8 | else => unreachable, | |
| 9 | }; | |
| 10 | _ = x; | |
| 11 | } | |
| 12 | ||
| 13 | // error | |
| 14 | // backend=stage1 | |
| 15 | // target=native | |
| 16 | // | |
| 17 | // tmp.zig:7:17: error: switch on type 'type' provides no expression parameter |
test/cases/compile_errors/stage1/use_of_comptime-known_undefined_function_value.zig deleted-13| ... | ... | @@ -1,13 +0,0 @@ |
| 1 | const Cmd = struct { | |
| 2 | exec: fn () void, | |
| 3 | }; | |
| 4 | export fn entry() void { | |
| 5 | const command = Cmd{ .exec = undefined }; | |
| 6 | command.exec(); | |
| 7 | } | |
| 8 | ||
| 9 | // error | |
| 10 | // backend=stage1 | |
| 11 | // target=native | |
| 12 | // | |
| 13 | // tmp.zig:6:12: error: use of undefined value here causes undefined behavior |