diff options
-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 b1ccedac..06ef76b2 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 |