diff options
| author | Lam Wei Lun <weilun.lam@gmail.com> | 2026-02-01 20:23:54 +0800 |
|---|---|---|
| committer | Lam Wei Lun <weilun.lam@gmail.com> | 2026-02-01 20:23:54 +0800 |
| commit | c4b73a1e99bda3cdfabe7ff3b64066b310ee7292 (patch) | |
| tree | a9ac8db385f82865e1bed5798ceaf63920587b2d /tests/features | |
| parent | fcc9210aa32d671e16b392cf48546c4e2001ff8f (diff) | |
| parent | eafd8c67012ea253436b79f703dc0702046703f8 (diff) | |
Merge with main
Diffstat (limited to 'tests/features')
| -rw-r--r-- | tests/features/test_asm_clobber.zc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/features/test_asm_clobber.zc b/tests/features/test_asm_clobber.zc new file mode 100644 index 0000000..2ba74da --- /dev/null +++ b/tests/features/test_asm_clobber.zc @@ -0,0 +1,20 @@ +fn add(a: int, b: int) -> int { + let result: int; + asm { + "mov {a}, {result}" + "add {b}, {result}" + : out(result) + : in(a), in(b) + : clobber("cc") + } + return result; +} + +test "asm_clobber" { + let res = add(10, 20); + if (res != 30) { + println "Failed: Expected 30, got {res}"; + exit(1); + } + println "Success: asm with clobber works properly"; +} |
