| author | |
| committer | |
| log | 40104f2145c3b7e2725604c0c777646a5fb621aa |
| tree | 02e83d43567901dde3871e0dac534b4f85ed75c4 |
| parent | 7b8fc18c666ba6952ad1571fbed4cc48e81f647d |
| signature |
2 files changed, 15 insertions(+), 1 deletions(-)
src/target.zig+8-1| ... | ... | @@ -487,7 +487,14 @@ pub fn minFunctionAlignment(target: std.Target) Alignment { |
| 487 | 487 | |
| 488 | 488 | pub fn supportsFunctionAlignment(target: std.Target) bool { |
| 489 | 489 | return switch (target.cpu.arch) { |
| 490 | .wasm32, .wasm64 => false, | |
| 490 | .nvptx, | |
| 491 | .nvptx64, | |
| 492 | .spirv, | |
| 493 | .spirv32, | |
| 494 | .spirv64, | |
| 495 | .wasm32, | |
| 496 | .wasm64, | |
| 497 | => false, | |
| 491 | 498 | else => true, |
| 492 | 499 | }; |
| 493 | 500 | } |
test/cases/compile_errors/function_alignment_on_unsupported_target.zig created+7| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | export fn entry() align(0) void {} | |
| 2 | ||
| 3 | // error | |
| 4 | // backend=stage2 | |
| 5 | // target=nvptx-cuda,nvptx64-cuda,spirv-vulkan,spirv32-opencl,spirv64-opencl,wasm32-freestanding,wasm64-freestanding | |
| 6 | // | |
| 7 | // :1:25: error: target does not support function alignment |