diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2015-12-02 00:53:57 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2015-12-02 00:53:57 -0700 |
| commit | 370de7386ce811b6381c3ffcf5dd8efd2810da2b (patch) | |
| tree | 3d3025ca84b7d5a34c8f835842f3cd78f123891e /test/run_tests.cpp | |
| parent | 08a2311efd8b388cd431feb6000741f4a62da613 (diff) | |
| download | zig-370de7386ce811b6381c3ffcf5dd8efd2810da2b.tar.gz zig-370de7386ce811b6381c3ffcf5dd8efd2810da2b.zip | |
fix parameter access and thus shared library example
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index c9855e8606..d4460bbdc2 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -213,6 +213,25 @@ static void add_compiling_test_cases(void) { exit(0); } )SOURCE", "1 is true\n!0 is true\n"); + + add_simple_case("params", R"SOURCE( + #link("c") + extern { + fn puts(s: *const u8) -> i32; + fn exit(code: i32) -> unreachable; + } + + fn add(a: i32, b: i32) -> i32 { + a + b + } + + export fn _start() -> unreachable { + if add(22, 11) == 33 { + puts("pass"); + } + exit(0); + } + )SOURCE", "pass\n"); } static void add_compile_failure_test_cases(void) { |
