summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2019-01-09 13:05:08 -0800
committerGitHub <noreply@github.com>2019-01-09 13:05:08 -0800
commit5f114452cd73fcad861660b2b715af726c925084 (patch)
tree3744e9aa60e25d8a4b0853ab027ff18181c0832a /CMakeLists.txt
parentaf5adae23e7cfcc2c933d72142a3d58576af769d (diff)
downloadbinaryen-5f114452cd73fcad861660b2b715af726c925084.tar.gz
binaryen-5f114452cd73fcad861660b2b715af726c925084.tar.bz2
binaryen-5f114452cd73fcad861660b2b715af726c925084.zip
Aligned allocation fixes. Fixes #1845 (#1846)
The error in #1845 shows: /<<PKGBUILDDIR>>/src/mixed_arena.h: In member function 'void* MixedArena::allocSpace(size_t, size_t)': /<<PKGBUILDDIR>>/src/mixed_arena.h:125:43: error: 'new' of type 'MixedArena::Chunk' {aka 'std::aligned_storage<32768, 16>::type'} with extended alignment 16 [-Werror=aligned-new=] chunks.push_back(new Chunk[numChunks]); ^ /<<PKGBUILDDIR>>/src/mixed_arena.h:125:43: note: uses 'void* operator new [](std::size_t)', which does not have an alignment parameter /<<PKGBUILDDIR>>/src/mixed_arena.h:125:43: note: use '-faligned-new' to enable C++17 over-aligned new support It turns out I had misread the aligned_storage docs, and they don't actually do what we need, which is a convenient cross-platform way to do aligned allocation, since new itself doesn't support that. Sadly it seems there is no cross-platform way to do it right now, so I added a header in support which abstracts over the windows and everything-else ways. Also add some ctest testing, which runs on windows, so we get basic windows coverage in our CI.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 95ae22864..ad111ae17 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -287,3 +287,18 @@ TARGET_LINK_LIBRARIES(wasm-reduce wasm asmjs passes wasm ir cfg support)
SET_PROPERTY(TARGET wasm-reduce PROPERTY CXX_STANDARD 11)
SET_PROPERTY(TARGET wasm-reduce PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm-reduce DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+# Testing
+#
+# Currently just some very simple smoke tests.
+
+ENABLE_TESTING()
+
+ADD_TEST(NAME opt-unit
+ COMMAND bin/wasm-opt test/unit.wast --flatten --ssa --metrics -O4 -Os --metrics)
+ADD_TEST(NAME metrics-emcc
+ COMMAND bin/wasm-opt test/emcc_hello_world.fromasm --metrics)
+ADD_TEST(NAME exec-unit
+ COMMAND bin/wasm-opt test/unit.wast --fuzz-exec)
+ADD_TEST(NAME exec-hello
+ COMMAND bin/wasm-opt test/hello_world.wast --fuzz-exec)