diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-04-27 14:41:46 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-04-27 14:41:46 -0700 |
commit | 63271d39f8a1100a703adc50861e02caefc2a9d5 (patch) | |
tree | de7b4fe1241aa14b71c135dbea2116131504f9db /test/wasm_backend/unaligned.cpp | |
parent | afcba6ce6e24d775c66bb82e23777a6ff1271f4f (diff) | |
download | binaryen-63271d39f8a1100a703adc50861e02caefc2a9d5.tar.gz binaryen-63271d39f8a1100a703adc50861e02caefc2a9d5.tar.bz2 binaryen-63271d39f8a1100a703adc50861e02caefc2a9d5.zip |
use ONLY hack only for _only files in test/wasm_backend
Diffstat (limited to 'test/wasm_backend/unaligned.cpp')
-rw-r--r-- | test/wasm_backend/unaligned.cpp | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/test/wasm_backend/unaligned.cpp b/test/wasm_backend/unaligned.cpp deleted file mode 100644 index 75f8b419b..000000000 --- a/test/wasm_backend/unaligned.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include <stdint.h> -#include <emscripten.h> - -void print(int v) { - int *x = (int*)8; - *x = v; - EM_ASM({ - Module.print("print: " + HEAP32[8>>2]); - }); -} - -char buffer[8]; - -int main() { - { - volatile int16_t* x; - x = (int16_t*)&buffer[0]; - *x = 0x1234; - print(*x); - x = (int16_t*)&buffer[1]; - *x = 0x2345; - print(*x); - } - { - volatile int32_t* x; - x = (int32_t*)&buffer[0]; - *x = 0x12345678; - print(*x); - x = (int32_t*)&buffer[1]; - *x = 0x23456789; - print(*x); - x = (int32_t*)&buffer[2]; - *x = 0x3456789a; - print(*x); - x = (int32_t*)&buffer[3]; - *x = 0x456789ab; - print(*x); - } - { - volatile float* x; - x = (float*)&buffer[0]; - *x = -0x12345678; - print(*x); - x = (float*)&buffer[1]; - *x = -0x12345678; - print(*x); - x = (float*)&buffer[2]; - *x = -0x12345678; - print(*x); - x = (float*)&buffer[3]; - *x = -0x12345678; - print(*x); - } - { - volatile double* x; - x = (double*)&buffer[0]; - *x = -1; - print(*x); - x = (double*)&buffer[1]; - *x = -2; - print(*x); - x = (double*)&buffer[2]; - *x = -3; - print(*x); - x = (double*)&buffer[3]; - *x = -4; - print(*x); - } -} - |