~ubuntu-branches/ubuntu/vivid/emscripten/vivid-proposed

« back to all changes in this revision

Viewing changes to tests/core/closebitcasts.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
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
 
 
3
int main(int argc, char **argv) {
 
4
  float x = argc%17, y = (argc+1)*(argc+2)*(argc+3)*(argc+4)*(argc*5);
 
5
  y *= 1<<30;
 
6
  y *= -13;
 
7
  if (argc == 17) { x++; y--; }
 
8
  int *xi = (int*)&x;
 
9
  int *yi = (int*)&y;
 
10
  int z = *xi - *yi;
 
11
  while (z % 15) {
 
12
    z++;
 
13
  }
 
14
  printf("!%d\n", z);
 
15
 
 
16
  double xd = x, yd = y;
 
17
  yd = yd*yd;
 
18
  yd = yd*yd;
 
19
  int *xl = (int*)&xd;
 
20
  int *xh = &((int*)&xd)[1];
 
21
  int *yl = (int*)&yd;
 
22
  int *yh = &((int*)&yd)[1];
 
23
  int l = *xl - *yl;
 
24
  int h = *xh - *yh;
 
25
  while (l % 15) {
 
26
    l++;
 
27
    h += 3;
 
28
  }
 
29
  printf("%d,%d!\n", l, h);
 
30
  return 0;
 
31
}
 
32