zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 08b0cae7778ea0946d595df451b9b4a65ff09abd (tree)
parent 015c899297c9fdc8ef9d0d22af29a7a0d0bdbc5c
Author: Jakub Konka <kubkon@jakubkonka.com>
Date:   Tue, 26 May 2020 18:00:08 +0200

Add matching compile error test

Diffstat:
Mtest/compile_errors.zig | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/test/compile_errors.zig b/test/compile_errors.zig @@ -7445,4 +7445,20 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { , &[_][]const u8{ ":2:75: error: operation caused overflow", }); + + cases.addCase(x: { + var tc = cases.create("align(N) expr function pointers is a compile error", + \\export fn foo() align(1) void { + \\ return; + \\} + , &[_][]const u8{ + "tmp.zig:1:23: error: align(N) expr is not allowed on function prototypes in wasm32/wasm64", + }); + tc.target = std.zig.CrossTarget{ + .cpu_arch = .wasm32, + .os_tag = .freestanding, + .abi = .none, + }; + break :x tc; + }); }