| ... | @@ -142,6 +142,15 @@ test "peer type resolution with C pointers" { | ... | @@ -142,6 +142,15 @@ test "peer type resolution with C pointers" { |
| 142 | try expect(@TypeOf(x4) == [*c]u8); | 142 | try expect(@TypeOf(x4) == [*c]u8); |
| 143 | } | 143 | } |
| 144 | | 144 | |
| | 145 | test "peer type resolution with C pointer and const pointer" { |
| | 146 | // stage1 incorrectly resolves to [*]u8 |
| | 147 | if (builtin.zig_backend == .stage1) return error.SkipZigTest; |
| | 148 | |
| | 149 | var ptr_c: [*c]u8 = undefined; |
| | 150 | const ptr_const: u8 = undefined; |
| | 151 | try expect(@TypeOf(ptr_c, &ptr_const) == [*c]const u8); |
| | 152 | } |
| | 153 | |
| 145 | test "implicit casting between C pointer and optional non-C pointer" { | 154 | test "implicit casting between C pointer and optional non-C pointer" { |
| 146 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | 155 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 147 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 156 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |