diff options
author | Josh Blum | 2013-09-05 00:53:21 -0700 |
---|---|---|
committer | Josh Blum | 2013-09-05 00:53:21 -0700 |
commit | a7ae7925eb8c393cdec972ed59a1ca0cb48253bd (patch) | |
tree | 35fb700245824046e842483c34ddde24edcdcf0f /tests | |
parent | eeb4d1e7e38e98f372ee21936c220ac6a5cb4efb (diff) | |
download | sandhi-a7ae7925eb8c393cdec972ed59a1ca0cb48253bd.tar.gz sandhi-a7ae7925eb8c393cdec972ed59a1ca0cb48253bd.tar.bz2 sandhi-a7ae7925eb8c393cdec972ed59a1ca0cb48253bd.zip |
gras: move sbuffer inlines into lib
This avoids inline ASM to be LLVM JIT friendly.
This commit includes a unit test for jit factory + sbuffer.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/jit_factory_test.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/jit_factory_test.py b/tests/jit_factory_test.py index 326313c..807abf8 100644 --- a/tests/jit_factory_test.py +++ b/tests/jit_factory_test.py @@ -146,5 +146,30 @@ class JITFactoryTest(unittest.TestCase): self.assertEqual(expected_result, actual_result) + def test_jit_compile_special(self): + SOURCE = """ +#include <gras/block.hpp> +#include <gras/factory.hpp> +#include <iostream> + +struct FooBar : gras::Block +{ + FooBar(void): + gras::Block("FooBar") + { + } + + void work(const InputItems &ins, const OutputItems &outs) + { + gras::SBufferConfig c0; + gras::SBuffer b0 = gras::SBuffer(c0); + gras::SBuffer i0 = this->get_input_buffer(0); + } +}; + +GRAS_REGISTER_FACTORY0("/tests/my_foo_bar", FooBar) +""" + gras.jit_factory(SOURCE, ["-O3", "-I"+gras_inc, "-I"+pmc_inc]) + if __name__ == '__main__': unittest.main() |