wasmer/lib/emscripten/emtests/test_em_asm_signatures.cpp

21 lines
797 B
C++
Raw Normal View History

2018-12-27 07:46:41 +00:00
#include <emscripten.h>
#include <stdio.h>
int main()
{
int ret = MAIN_THREAD_EM_ASM_INT(return 1);
ret += MAIN_THREAD_EM_ASM_INT(return $0, 1);
ret += MAIN_THREAD_EM_ASM_INT(return $0 + $1, 1, 2);
ret += MAIN_THREAD_EM_ASM_INT(return $0 + $1 + $2, 1, 2, 3);
ret += MAIN_THREAD_EM_ASM_INT(return $0 + $1 + $2 + $3, 1, 2, 3, 4);
ret += MAIN_THREAD_EM_ASM_INT(return $0 + $1 + $2 + $3 + $4, 1, 2, 3, 4, 5);
ret += MAIN_THREAD_EM_ASM_INT(return $0 + $1 + $2 + $3 + $4 + $5, 1, 2, 3, 4, 5, 6);
ret += MAIN_THREAD_EM_ASM_INT(return $0 + $1 + $2 + $3 + $4 + $5 + $6, 1, 2, 3, 4, 5, 6, 7);
ret += MAIN_THREAD_EM_ASM_INT(return $0 + $1 + $2 + $3 + $4 + $5 + $6 + $7, 1, 2, 3, 4, 5, 6, 7, 8);
printf("ret: %d\n", ret);
#ifdef REPORT_RESULT
REPORT_RESULT(ret);
#endif
return ret;
}