wasmer/lib/emscripten/emtests/test_i16_emcc_intrinsic.c
2019-01-10 21:38:10 -08:00

26 lines
660 B
C
Vendored

/*
* Copyright 2016 The Emscripten Authors. All rights reserved.
* Emscripten is available under two separate licenses, the MIT license and the
* University of Illinois/NCSA Open Source License. Both these licenses can be
* found in the LICENSE file.
*/
#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;
}