diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-25 20:09:18 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-25 20:09:18 -0500 |
| commit | 152db27146e8b219af118abae8d235831aad2153 (patch) | |
| tree | 91f94e66e9757620cc21a06afbff78720509fec3 /test/compile_errors.zig | |
| parent | 3ca861c7dd048a8bc15b6776a3b56fdc790750f7 (diff) | |
| download | zig-152db27146e8b219af118abae8d235831aad2153.tar.gz zig-152db27146e8b219af118abae8d235831aad2153.zip | |
better error message when forgetting to link against libc
closes #1698
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 37b39706b5..d11c077164 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,16 @@ const tests = @import("tests.zig"); pub fn addCases(cases: *tests.CompileErrorContext) void { cases.addTest( + "implicit dependency on libc", + \\extern "c" fn exit(u8) void; + \\export fn entry() void { + \\ exit(0); + \\} + , + ".tmp_source.zig:3:5: error: dependency on library c must be explicitly specified in the build command", + ); + + cases.addTest( "libc headers note", \\const c = @cImport(@cInclude("stdio.h")); \\export fn entry() void { |
