| ... | @@ -316,7 +316,8 @@ test "cast from ?[*]T to ??[*]T" { | ... | @@ -316,7 +316,8 @@ test "cast from ?[*]T to ??[*]T" { |
| 316 | } | 316 | } |
| 317 | | 317 | |
| 318 | test "peer type unsigned int to signed" { | 318 | test "peer type unsigned int to signed" { |
| 319 | if (builtin.zig_backend == .stage2_x86_64 or builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 320 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 320 | | 321 | |
| 321 | var w: u31 = 5; | 322 | var w: u31 = 5; |
| 322 | var x: u8 = 7; | 323 | var x: u8 = 7; |
| ... | @@ -325,3 +326,13 @@ test "peer type unsigned int to signed" { | ... | @@ -325,3 +326,13 @@ test "peer type unsigned int to signed" { |
| 325 | comptime try expect(@TypeOf(a) == i32); | 326 | comptime try expect(@TypeOf(a) == i32); |
| 326 | try expect(a == 7); | 327 | try expect(a == 7); |
| 327 | } | 328 | } |
| | 329 | |
| | 330 | test "expected [*c]const u8, found [*:0]const u8" { |
| | 331 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 332 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| | 333 | |
| | 334 | var a: [*:0]const u8 = "hello"; |
| | 335 | var b: [*c]const u8 = a; |
| | 336 | var c: [*:0]const u8 = b; |
| | 337 | try expect(std.mem.eql(u8, c[0..5], "hello")); |
| | 338 | } |