diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-27 23:22:37 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-27 23:23:02 -0700 |
| commit | 97c61313dab659e4934e0dd31ffa89284151017b (patch) | |
| tree | fda7c30a0ec9ecdff64b7c0a5f74de776b488368 /test/run_tests.cpp | |
| parent | 51ab9b03ce97666fd7fd56cf0f81b11fb1709bc6 (diff) | |
| download | zig-97c61313dab659e4934e0dd31ffa89284151017b.tar.gz zig-97c61313dab659e4934e0dd31ffa89284151017b.zip | |
c_import of stdio.h works for some functions
See #88
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 73478c6b55..17d45d1203 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -98,7 +98,11 @@ static void add_compiling_test_cases(void) { add_simple_case("hello world with libc", R"SOURCE( #link("c") export executable "test"; -extern fn puts(s: &const u8) -> c_int; + +c_import { + @c_include("stdio.h"); +} + export fn main(argc: c_int, argv: &&u8) -> c_int { puts(c"Hello, world!"); return 0; @@ -481,7 +485,10 @@ pub fn main(args: [][]u8) -> %void { add_simple_case("number literals", R"SOURCE( #link("c") export executable "test"; -extern fn printf(__format: &const u8, ...) -> c_int; + +c_import { + @c_include("stdio.h"); +} export fn main(argc: c_int, argv: &&u8) -> c_int { printf(c"\n"); |
