mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 05:20:34 +00:00
parent
9daa7e1e19
commit
f077c3c4cc
@ -19500,6 +19500,7 @@ static IrInstruction *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstruct
|
||||
}
|
||||
|
||||
if (orig_array_ptr_val->special != ConstValSpecialRuntime &&
|
||||
orig_array_ptr_val->data.x_ptr.special != ConstPtrSpecialHardCodedAddr &&
|
||||
(orig_array_ptr_val->data.x_ptr.mut != ConstPtrMutRuntimeVar ||
|
||||
array_type->id == ZigTypeIdArray))
|
||||
{
|
||||
|
||||
@ -282,3 +282,9 @@ test "pointer sentinel with +inf" {
|
||||
S.doTheTest();
|
||||
comptime S.doTheTest();
|
||||
}
|
||||
|
||||
test "pointer to array at fixed address" {
|
||||
const array = @intToPtr(*volatile [1]u32, 0x10);
|
||||
// Silly check just to reference `array`
|
||||
expect(@ptrToInt(&array[0]) == 0x10);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user