compiler: Disallow function alignment for nvptx and spirv.

This commit is contained in:
Alex Rønne Petersen 2024-10-15 20:34:56 +02:00
parent 7b8fc18c66
commit 40104f2145
No known key found for this signature in database
2 changed files with 15 additions and 1 deletions

View File

@ -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,
};
}

View File

@ -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