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

int test(unsigned short a, unsigned short b) {
  unsigned short result = a;
  result += b;
  if (result < b) printf("C!");
  return result;
}

int main(void) {
  printf(",%d,", test(0, 0));
  printf(",%d,", test(1, 1));
  printf(",%d,", test(65535, 1));
  printf(",%d,", test(1, 65535));
  printf(",%d,", test(32768, 32767));
  printf(",%d,", test(32768, 32768));
  return 0;
}