mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 00:08:56 +00:00
compiler: Disallow function alignment for nvptx and spirv.
This commit is contained in:
parent
7b8fc18c66
commit
40104f2145
@ -487,7 +487,14 @@ pub fn minFunctionAlignment(target: std.Target) Alignment {
|
||||
|
||||
pub fn supportsFunctionAlignment(target: std.Target) bool {
|
||||
return switch (target.cpu.arch) {
|
||||
.wasm32, .wasm64 => false,
|
||||
.nvptx,
|
||||
.nvptx64,
|
||||
.spirv,
|
||||
.spirv32,
|
||||
.spirv64,
|
||||
.wasm32,
|
||||
.wasm64,
|
||||
=> false,
|
||||
else => true,
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
export fn entry() align(0) void {}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=nvptx-cuda,nvptx64-cuda,spirv-vulkan,spirv32-opencl,spirv64-opencl,wasm32-freestanding,wasm64-freestanding
|
||||
//
|
||||
// :1:25: error: target does not support function alignment
|
||||
Loading…
x
Reference in New Issue
Block a user