diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-10 10:09:39 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-10 10:09:39 +0100 |
| commit | 137af331b95311f3abfa9fe59e7efc68843f6c37 (patch) | |
| tree | 5eaf8aab12f6c41ba8d5ac0f2cdbe4bd7e2264fb /test | |
| parent | 462a7e9796970b259815369ffaf4c5e24af3139c (diff) | |
feat: necdrv: Code generation improvements and WiP specs.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_samples/ostream.ncpp | 32 | ||||
| -rw-r--r-- | test/test_samples/ostream_test.ncpp | 37 | ||||
| -rw-r--r-- | test/test_samples/sample.ncpp | 10 |
3 files changed, 37 insertions, 42 deletions
diff --git a/test/test_samples/ostream.ncpp b/test/test_samples/ostream.ncpp deleted file mode 100644 index f9b4d44..0000000 --- a/test/test_samples/ostream.ncpp +++ /dev/null @@ -1,32 +0,0 @@ -export ncpp::ostream; -import printf, getchar, malloc; - -struct iostream -{ - type <class Tp_> - void consume(Tp_& val) - { - printf("%p", val); - } - - void consume<long>(long& val) - { - printf("%uz", val); - } - - void consume<bool>(bool& val) - { - printf("%b", val); - } - - long read() - { - return getchar(); - } -}; - -let shared_io() -{ - let io = malloc(sizeof(iostream)); - return io; -}
\ No newline at end of file diff --git a/test/test_samples/ostream_test.ncpp b/test/test_samples/ostream_test.ncpp new file mode 100644 index 0000000..48e58c8 --- /dev/null +++ b/test/test_samples/ostream_test.ncpp @@ -0,0 +1,37 @@ +struct iostream +{ + type <class Tp_> + let consume(Tp_& val) + { + return; + } + + let consume<long>(long& val) + { + return; + } + + let consume<bool>(bool& val) + { + return; + } + + let read() + { + let ch = getchar(); + return ch; + } +}; + +int main(void) +{ + let six_seven = 100; + let eight_nine = 1; + + let io = iostream(); + + io.consume(eight_nine); + io.consume(six_seven); + + return 0; +} diff --git a/test/test_samples/sample.ncpp b/test/test_samples/sample.ncpp deleted file mode 100644 index 04c590e..0000000 --- a/test/test_samples/sample.ncpp +++ /dev/null @@ -1,10 +0,0 @@ -import ncpp::ostream; - -int main(void) -{ - let six_seven = 100; - let eight_nine = 1; - shared_io()->consume(1, 67); - - return 0; -} |
