aboutsummaryrefslogtreecommitdiff
path: root/tests/core/test_inlinejs3.in
blob: 3e1913ffa24d325bd89199cd8c22b0896244f1e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <emscripten.h>

int main(int argc, char **argv) {
  EM_ASM(Module.print('hello dere1'));
  EM_ASM(Module.print('hello dere2'););
  for (int i = 0; i < 3; i++) {
    EM_ASM(Module.print('hello dere3'); Module.print('hello dere' + 4););
  }
  int sum = 0;
  for (int i = 0; i < argc * 3; i++) {
    sum += EM_ASM_INT({
                        Module.print('i: ' + [ $0, ($1).toFixed(2) ]);
                        return $0 * 2;
                      },
                      i, double(i) / 12);
  }
  printf("sum: %d\n", sum);
  return 0;
}