diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-11 10:14:54 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-11 18:36:27 +0300 |
commit | a1b9fd28f9392143ad571cb5567192c0ec3b5e73 (patch) | |
tree | 516c9adb47a3884b70320804b0ca4615be080d65 /tests/test_core.py | |
parent | 6c4d3fff3e5da4352e2a111175ea0de6265a8729 (diff) |
Add new unit test for inline asm syntax passing through input variables to output variables.
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index 54fbdcd1..054721f9 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -3756,11 +3756,18 @@ def process(filename): int main() { asm("Module.print('Inline JS is very cool')"); printf("%.2f\n", get()); + + // Test that passing multiple input and output variables works. + int src1 = 1, src2 = 2, src3 = 3; + int dst1 = 0, dst2 = 0, dst3 = 0; + asm("Module.print(%3); Module.print(%4); Module.print(%5); %0 = %3; %1 = %4; %2 = %5;" : "=r"(dst1),"=r"(dst2),"=r"(dst3): "r"(src1),"r"(src2),"r"(src3)); + printf("%d\n%d\n%d\n", dst1, dst2, dst3); + return 0; } ''' - self.do_run(src, 'Inline JS is very cool\n3.64\n') + self.do_run(src, 'Inline JS is very cool\n3.64\n1\n2\n3\n1\n2\n3\n') def test_inlinejs2(self): if Settings.ASM_JS: Settings.ASM_JS = 2 # skip validation, asm does not support random code |