Skip to content

Commit 16c99cf

Browse files
committed
Add test file.
1 parent 3644159 commit 16c99cf

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/embind/test_bigint.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <cstdint>
2+
#include <emscripten.h>
3+
#include <emscripten/bind.h>
4+
5+
int64_t getBigInt() {
6+
return 1000000000000;
7+
}
8+
9+
uint64_t getBigUInt() {
10+
return -1000000000000;
11+
}
12+
13+
int main() {
14+
EM_ASM(
15+
console.log(Module.getBigInt());
16+
console.log(Module.getBigUInt());
17+
);
18+
}
19+
20+
EMSCRIPTEN_BINDINGS(my_module) {
21+
emscripten::function("getBigInt", &getBigInt);
22+
emscripten::function("getBigUInt", &getBigUInt);
23+
}

0 commit comments

Comments
 (0)