File: globals_only.cpp

package info (click to toggle)
binaryen 68-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 34,900 kB
  • sloc: cpp: 57,351; ansic: 3,562; python: 2,898; sh: 700; makefile: 6
file content (21 lines) | stat: -rw-r--r-- 243 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <emscripten.h>

char c = 10;
short s = 20;
int i = 55;

void print(int v) {
  int *x = (int*)8;
  *x = v;
  EM_ASM({
    Module.print("print: " + HEAP32[8>>2]);
  });
}

int main() {
  print(1);
  print(c);
  print(s);
  print(i);
}