diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-14 23:59:54 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-14 23:59:54 +0000 |
| commit | dcfdc053cb5f9fb4d5eac0a2233c75126b7a8188 (patch) | |
| tree | f34f30b382fa22d6fd0af46875a5b4b26d00feff /tests/features/test_intel.zc | |
| parent | a918df69269a39ef7350a645b5db025d66ecb18a (diff) | |
Added some of the tests.
Diffstat (limited to 'tests/features/test_intel.zc')
| -rw-r--r-- | tests/features/test_intel.zc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/features/test_intel.zc b/tests/features/test_intel.zc new file mode 100644 index 0000000..8547501 --- /dev/null +++ b/tests/features/test_intel.zc @@ -0,0 +1,22 @@ +//> cflags: -masm=intel + +fn add_five_intel(x: int) -> int { + var result: int; + asm { + "mov {result}, {x}" + "add {result}, 5" + : out(result) + : in(x) + } + return result; +} + +test "test_intel" { + var val = add_five_intel(10); + "Sum Intel: 10 + 5 = {val}"; + + match val { + 15 => printf("-> Success!\n") + _ => printf("-> Failed: expected 15, got {val}\n") + } +} |
