diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-30 14:22:45 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-30 14:22:45 +0100 |
| commit | 0c75d961dfbc7928c1459a10c71669f5b79d2ebf (patch) | |
| tree | 61a4303fbe996a9058f07fc27ec404b32f301d16 | |
| parent | 4ed27545ece2dc084508cc0aca288fa866ae1879 (diff) | |
feat: prepping: fix nebuild rules, adding test cases for future expansions.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -rw-r--r-- | CLAUDE.md | 2 | ||||
| -rw-r--r-- | src/CommandLine/asm.json | 2 | ||||
| -rw-r--r-- | src/CommandLine/cppdrv.json | 2 | ||||
| -rw-r--r-- | src/CommandLine/kdbg.json | 2 | ||||
| -rw-r--r-- | src/CommandLine/ld64.json | 2 | ||||
| -rw-r--r-- | test/test_samples/class_ctor_dtor.cc | 15 | ||||
| -rw-r--r-- | test/test_samples/class_methods.cc | 13 | ||||
| -rw-r--r-- | test/test_samples/class_simple.cc | 10 | ||||
| -rw-r--r-- | test/test_samples/namespace_basic.cc | 9 |
9 files changed, 52 insertions, 5 deletions
@@ -102,7 +102,7 @@ The project supports **5 CPU architectures**: - **ARM64** (AArch64) - **PowerPC** (64-bit POWER) - **64x0** - Open64x0 RISC architecture -- **32x0** - 32-bit variant +- **32x0** - 32-bit variant of Open64x0 Each architecture has dedicated assembler implementations in `src/CompilerKit/src/Assemblers/Assembler+<ARCH>.cc`. diff --git a/src/CommandLine/asm.json b/src/CommandLine/asm.json index 66102d2..7107c4b 100644 --- a/src/CommandLine/asm.json +++ b/src/CommandLine/asm.json @@ -1,7 +1,7 @@ { "compiler_path": "clang++", "compiler_std": "c++20", - "headers_path": ["../CompilerKit", "../", "../CompilerKit/src/Detail"], + "headers_path": ["../../include/CompilerKit", "../../include", "../../include/CompilerKit/src/Detail"], "sources_path": ["asm.cc"], "output_name": "asm", "compiler_flags": ["-L/usr/lib", "-lCompilerKit"], diff --git a/src/CommandLine/cppdrv.json b/src/CommandLine/cppdrv.json index 847be75..3fa222e 100644 --- a/src/CommandLine/cppdrv.json +++ b/src/CommandLine/cppdrv.json @@ -1,7 +1,7 @@ { "compiler_path": "clang++", "compiler_std": "c++20", - "headers_path": ["../CompilerKit", "../", "../CompilerKit/src/Detail"], + "headers_path": ["../../include/CompilerKit", "../../include/", "../../include/CompilerKit/src/Detail"], "sources_path": ["cppdrv.cc"], "output_name": "cppdrv", "compiler_flags": ["-L/usr/local/lib", "-lCompilerKit"], diff --git a/src/CommandLine/kdbg.json b/src/CommandLine/kdbg.json index c04978d..8c36932 100644 --- a/src/CommandLine/kdbg.json +++ b/src/CommandLine/kdbg.json @@ -1,7 +1,7 @@ { "compiler_path": "clang++", "compiler_std": "c++20", - "headers_path": ["../CompilerKit", "../", "../CompilerKit/src/Detail"], + "headers_path": ["../../include/CompilerKit", "../../include/", "../../include/CompilerKit/src/Detail"], "sources_path": ["kdbg.cc"], "output_name": "kdbg", "compiler_flags": ["-L/usr/lib", "-lDebuggerKit"], diff --git a/src/CommandLine/ld64.json b/src/CommandLine/ld64.json index 9b0c52e..dff0720 100644 --- a/src/CommandLine/ld64.json +++ b/src/CommandLine/ld64.json @@ -1,7 +1,7 @@ { "compiler_path": "clang++", "compiler_std": "c++20", - "headers_path": ["../CompilerKit", "../", "../CompilerKit/src/Detail"], + "headers_path": ["../../include/CompilerKit", "../../include/", "../../include/CompilerKit/src/Detail"], "sources_path": ["ld64.cc"], "output_name": "ld64", "compiler_flags": ["-L/usr/lib", "-lCompilerKit"], diff --git a/test/test_samples/class_ctor_dtor.cc b/test/test_samples/class_ctor_dtor.cc new file mode 100644 index 0000000..728a62c --- /dev/null +++ b/test/test_samples/class_ctor_dtor.cc @@ -0,0 +1,15 @@ +#define main __ImageStart + +class MyClass { + MyClass() { + // Constructor + } + + ~MyClass() { + // Destructor + } +}; + +int main() { + return 0; +} diff --git a/test/test_samples/class_methods.cc b/test/test_samples/class_methods.cc new file mode 100644 index 0000000..ce9a73a --- /dev/null +++ b/test/test_samples/class_methods.cc @@ -0,0 +1,13 @@ +#define main __ImageStart + +class Counter { + int count; + + void increment() { count += 1; } + + int getCount() { return count; } +}; + +int main() { + return 0; +} diff --git a/test/test_samples/class_simple.cc b/test/test_samples/class_simple.cc new file mode 100644 index 0000000..604922d --- /dev/null +++ b/test/test_samples/class_simple.cc @@ -0,0 +1,10 @@ +#define main __ImageStart + +class Point { + int x; + int y; +}; + +int main() { + return 0; +} diff --git a/test/test_samples/namespace_basic.cc b/test/test_samples/namespace_basic.cc new file mode 100644 index 0000000..357304b --- /dev/null +++ b/test/test_samples/namespace_basic.cc @@ -0,0 +1,9 @@ +namespace Math { +int add() { + return 5; +} +} // namespace Math + +int main() { + return Math::add(); +} |
