zig/test/cases/spirv_mergable_pointers.zig
Robin Voetter 49a067ccfe
spirv: forbid merging logical pointers
Under some architecture/operating system combinations it is forbidden
to return a pointer from a merge, as these pointers must point to a
location at compile time. This adds a check for those cases when
returning a pointer from a block merge.
2024-10-27 16:31:45 +01:00

17 lines
308 B
Zig

export fn a() void {
var x: *addrspace(.global) i32 = undefined;
_ = &x;
var y: *addrspace(.global) i32 = undefined;
_ = &y;
var rt_cond = false;
_ = &rt_cond;
var z = if (rt_cond) x else y;
_ = &z;
}
// compile
// output_mode=Obj
// backend=stage2
// target=spirv64-vulkan