~ubuntu-branches/ubuntu/trusty/emscripten/trusty-proposed

« back to all changes in this revision

Viewing changes to tests/core/test_inlinejs3.in

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20140119141240-jg1l42cc158j59tn
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <emscripten.h>
 
3
 
 
4
int main(int argc, char **argv) {
 
5
  EM_ASM(Module.print('hello dere1'));
 
6
  EM_ASM(Module.print('hello dere2'););
 
7
  for (int i = 0; i < 3; i++) {
 
8
    EM_ASM(Module.print('hello dere3'); Module.print('hello dere' + 4););
 
9
  }
 
10
  int sum = 0;
 
11
  for (int i = 0; i < argc * 3; i++) {
 
12
    sum += EM_ASM_INT({
 
13
                        Module.print('i: ' + [ $0, ($1).toFixed(2) ]);
 
14
                        return $0 * 2;
 
15
                      },
 
16
                      i, double(i) / 12);
 
17
  }
 
18
  printf("sum: %d\n", sum);
 
19
  return 0;
 
20
}