summaryrefslogtreecommitdiff
path: root/test/mem.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2021-09-29 11:23:09 -0700
committerGitHub <noreply@github.com>2021-09-29 11:23:09 -0700
commit6b80ef6cccfd14b9b6620c5d41a148024d78576c (patch)
tree27f1a0cc96a512d6ed80f3f5b40e83de98e2e9f9 /test/mem.cpp
parent414d54a28b749af6abcaec6b85c99cc69de6b7dd (diff)
downloadbinaryen-6b80ef6cccfd14b9b6620c5d41a148024d78576c.tar.gz
binaryen-6b80ef6cccfd14b9b6620c5d41a148024d78576c.tar.bz2
binaryen-6b80ef6cccfd14b9b6620c5d41a148024d78576c.zip
Clang-format c/cpp files in test directory (#4192)
This clang-formats c/cpp files in test/ directory, and updates clang-format-diff.sh so that it does not ignore test/ directory anymore. bigswitch.cpp is excluded from formatting, because there are big commented-out code blocks, and apparently clang-format messes up formatting in them. Also to make matters worse, different clang-format versions do different things on those commented-out code blocks.
Diffstat (limited to 'test/mem.cpp')
-rw-r--r--test/mem.cpp36
1 files changed, 25 insertions, 11 deletions
diff --git a/test/mem.cpp b/test/mem.cpp
index e45149df1..eac12b311 100644
--- a/test/mem.cpp
+++ b/test/mem.cpp
@@ -1,5 +1,5 @@
-#include <stdint.h>
#include <emscripten.h>
+#include <stdint.h>
extern "C" {
@@ -14,21 +14,35 @@ int EMSCRIPTEN_KEEPALIVE loadu32(size_t addr) { return ((uint32_t*)addr)[0]; }
double EMSCRIPTEN_KEEPALIVE loadf32(size_t addr) { return ((float*)addr)[0]; }
double EMSCRIPTEN_KEEPALIVE loadf64(size_t addr) { return ((double*)addr)[0]; }
-void EMSCRIPTEN_KEEPALIVE storei8(size_t addr, int8_t v) { ((int8_t*)addr)[0] = v; }
-void EMSCRIPTEN_KEEPALIVE storei16(size_t addr, int16_t v) { ((int16_t*)addr)[0] = v; }
-void EMSCRIPTEN_KEEPALIVE storei32(size_t addr, int32_t v) { ((int32_t*)addr)[0] = v; }
+void EMSCRIPTEN_KEEPALIVE storei8(size_t addr, int8_t v) {
+ ((int8_t*)addr)[0] = v;
+}
+void EMSCRIPTEN_KEEPALIVE storei16(size_t addr, int16_t v) {
+ ((int16_t*)addr)[0] = v;
+}
+void EMSCRIPTEN_KEEPALIVE storei32(size_t addr, int32_t v) {
+ ((int32_t*)addr)[0] = v;
+}
-void EMSCRIPTEN_KEEPALIVE storeu8(size_t addr, uint8_t v) { ((uint8_t*)addr)[0] = v; }
-void EMSCRIPTEN_KEEPALIVE storeu16(size_t addr, uint16_t v) { ((uint16_t*)addr)[0] = v; }
-void EMSCRIPTEN_KEEPALIVE storeu32(size_t addr, uint32_t v) { ((uint32_t*)addr)[0] = v; }
+void EMSCRIPTEN_KEEPALIVE storeu8(size_t addr, uint8_t v) {
+ ((uint8_t*)addr)[0] = v;
+}
+void EMSCRIPTEN_KEEPALIVE storeu16(size_t addr, uint16_t v) {
+ ((uint16_t*)addr)[0] = v;
+}
+void EMSCRIPTEN_KEEPALIVE storeu32(size_t addr, uint32_t v) {
+ ((uint32_t*)addr)[0] = v;
+}
-void EMSCRIPTEN_KEEPALIVE storef32(size_t addr, float v) { ((float*)addr)[0] = v; }
-void EMSCRIPTEN_KEEPALIVE storef64(size_t addr, double v) { ((double*)addr)[0] = v; }
+void EMSCRIPTEN_KEEPALIVE storef32(size_t addr, float v) {
+ ((float*)addr)[0] = v;
+}
+void EMSCRIPTEN_KEEPALIVE storef64(size_t addr, double v) {
+ ((double*)addr)[0] = v;
+}
int* EMSCRIPTEN_KEEPALIVE get_stack() {
int t;
return &t;
}
-
}
-