| author | |
| committer | |
| log | 5eafc10bf41451fb694f324dcaefe5c458e1ca3a |
| tree | 45ee1879f0a2b0b6b198cb4136f04e5cc1868de9 |
| parent | c126a1018eec54c568aaa642013e3c86bdd6d3e4 |
9 files changed, 4 insertions(+), 22 deletions(-)
src/codegen/c.zig+4-3| ... | ... | @@ -393,7 +393,10 @@ pub const DeclGen = struct { |
| 393 | 393 | val: Value, |
| 394 | 394 | decl_index: Decl.Index, |
| 395 | 395 | ) error{ OutOfMemory, AnalysisFail }!void { |
| 396 | if (ty.isPtrAtRuntime() and !ty.elemType2().isFnOrHasRuntimeBits()) { | |
| 396 | const decl = dg.module.declPtr(decl_index); | |
| 397 | assert(decl.has_tv); | |
| 398 | ||
| 399 | if (ty.isPtrAtRuntime() and !decl.ty.isFnOrHasRuntimeBits()) { | |
| 397 | 400 | return dg.writeCValue(writer, CValue{ .undefined_ptr = ty }); |
| 398 | 401 | } |
| 399 | 402 | |
| ... | ... | @@ -409,8 +412,6 @@ pub const DeclGen = struct { |
| 409 | 412 | return; |
| 410 | 413 | } |
| 411 | 414 | |
| 412 | const decl = dg.module.declPtr(decl_index); | |
| 413 | assert(decl.has_tv); | |
| 414 | 415 | // We shouldn't cast C function pointers as this is UB (when you call |
| 415 | 416 | // them). The analysis until now should ensure that the C function |
| 416 | 417 | // pointers are compatible. If they are not, then there is a bug |
test/behavior/bugs/12984.zig-1| ... | ... | @@ -14,7 +14,6 @@ pub const CustomDraw = DeleagateWithContext(fn (?OnConfirm) void); |
| 14 | 14 | test "simple test" { |
| 15 | 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 16 | 16 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 17 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 18 | 17 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 19 | 18 | |
| 20 | 19 | var c: CustomDraw = undefined; |
test/behavior/bugs/1914.zig-1| ... | ... | @@ -29,6 +29,5 @@ pub const B2 = struct { |
| 29 | 29 | var b_value = B2{ .pointer_array = &[_]*A2{} }; |
| 30 | 30 | |
| 31 | 31 | test "basic stuff" { |
| 32 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 33 | 32 | std.debug.assert(&b_value == &b_value); |
| 34 | 33 | } |
test/behavior/cast.zig-7| ... | ... | @@ -450,7 +450,6 @@ fn castToOptionalTypeError(z: i32) !void { |
| 450 | 450 | |
| 451 | 451 | test "implicitly cast from [0]T to anyerror![]T" { |
| 452 | 452 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 453 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 454 | 453 | |
| 455 | 454 | try testCastZeroArrayToErrSliceMut(); |
| 456 | 455 | comptime try testCastZeroArrayToErrSliceMut(); |
| ... | ... | @@ -466,7 +465,6 @@ fn gimmeErrOrSlice() anyerror![]u8 { |
| 466 | 465 | |
| 467 | 466 | test "peer type resolution: [0]u8, []const u8, and anyerror![]u8" { |
| 468 | 467 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 469 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 470 | 468 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 471 | 469 | |
| 472 | 470 | const S = struct { |
| ... | ... | @@ -810,7 +808,6 @@ test "peer type resolution: error union after non-error" { |
| 810 | 808 | test "peer cast *[0]T to E![]const T" { |
| 811 | 809 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 812 | 810 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 813 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 814 | 811 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 815 | 812 | |
| 816 | 813 | var buffer: [5]u8 = "abcde".*; |
| ... | ... | @@ -825,7 +822,6 @@ test "peer cast *[0]T to E![]const T" { |
| 825 | 822 | test "peer cast *[0]T to []const T" { |
| 826 | 823 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 827 | 824 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 828 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 829 | 825 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 830 | 826 | |
| 831 | 827 | var buffer: [5]u8 = "abcde".*; |
| ... | ... | @@ -1131,7 +1127,6 @@ fn returnNullLitFromOptionalTypeErrorRef() anyerror!?*A { |
| 1131 | 1127 | |
| 1132 | 1128 | test "peer type resolution: [0]u8 and []const u8" { |
| 1133 | 1129 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1134 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 1135 | 1130 | |
| 1136 | 1131 | try expect(peerTypeEmptyArrayAndSlice(true, "hi").len == 0); |
| 1137 | 1132 | try expect(peerTypeEmptyArrayAndSlice(false, "hi").len == 1); |
| ... | ... | @@ -1214,7 +1209,6 @@ fn incrementVoidPtrValue(value: ?*anyopaque) void { |
| 1214 | 1209 | |
| 1215 | 1210 | test "implicit cast *[0]T to E![]const u8" { |
| 1216 | 1211 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1217 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 1218 | 1212 | |
| 1219 | 1213 | var x = @as(anyerror![]const u8, &[0]u8{}); |
| 1220 | 1214 | try expect((x catch unreachable).len == 0); |
| ... | ... | @@ -1386,7 +1380,6 @@ test "coerce undefined single-item pointer of array to error union of slice" { |
| 1386 | 1380 | } |
| 1387 | 1381 | |
| 1388 | 1382 | test "pointer to empty struct literal to mutable slice" { |
| 1389 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 1390 | 1383 | var x: []i32 = &.{}; |
| 1391 | 1384 | try expect(x.len == 0); |
| 1392 | 1385 | } |
test/behavior/fn.zig-1| ... | ... | @@ -405,7 +405,6 @@ test "function with inferred error set but returning no error" { |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | test "import passed byref to function in return type" { |
| 408 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 409 | 408 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 410 | 409 | |
| 411 | 410 | const S = struct { |
test/behavior/slice.zig-3| ... | ... | @@ -169,7 +169,6 @@ test "comptime pointer cast array and then slice" { |
| 169 | 169 | |
| 170 | 170 | test "slicing zero length array" { |
| 171 | 171 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 172 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 173 | 172 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 174 | 173 | |
| 175 | 174 | const s1 = ""[0..]; |
| ... | ... | @@ -206,8 +205,6 @@ test "slice string literal has correct type" { |
| 206 | 205 | } |
| 207 | 206 | |
| 208 | 207 | test "result location zero sized array inside struct field implicit cast to slice" { |
| 209 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 210 | ||
| 211 | 208 | const E = struct { |
| 212 | 209 | entries: []u32, |
| 213 | 210 | }; |
test/behavior/struct.zig-1| ... | ... | @@ -365,7 +365,6 @@ const EmptyStruct = struct { |
| 365 | 365 | |
| 366 | 366 | test "align 1 field before self referential align 8 field as slice return type" { |
| 367 | 367 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 368 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 369 | 368 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 370 | 369 | |
| 371 | 370 | const result = alloc(Expr); |
test/behavior/struct_contains_slice_of_itself.zig-2| ... | ... | @@ -12,7 +12,6 @@ const NodeAligned = struct { |
| 12 | 12 | }; |
| 13 | 13 | |
| 14 | 14 | test "struct contains slice of itself" { |
| 15 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 16 | 15 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 17 | 16 | |
| 18 | 17 | var other_nodes = [_]Node{ |
| ... | ... | @@ -52,7 +51,6 @@ test "struct contains slice of itself" { |
| 52 | 51 | } |
| 53 | 52 | |
| 54 | 53 | test "struct contains aligned slice of itself" { |
| 55 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 56 | 54 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 57 | 55 | |
| 58 | 56 | var other_nodes = [_]NodeAligned{ |
test/behavior/tuple.zig-3| ... | ... | @@ -257,7 +257,6 @@ test "initializing anon struct with mixed comptime-runtime fields" { |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | test "tuple in tuple passed to generic function" { |
| 260 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 261 | 260 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 262 | 261 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 263 | 262 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| ... | ... | @@ -277,7 +276,6 @@ test "tuple in tuple passed to generic function" { |
| 277 | 276 | } |
| 278 | 277 | |
| 279 | 278 | test "coerce tuple to tuple" { |
| 280 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 281 | 279 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 282 | 280 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 283 | 281 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| ... | ... | @@ -292,7 +290,6 @@ test "coerce tuple to tuple" { |
| 292 | 290 | } |
| 293 | 291 | |
| 294 | 292 | test "tuple type with void field" { |
| 295 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 296 | 293 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 297 | 294 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 298 | 295 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |