swh:1:snp:70f530b74f5be73cfb71c212c9e3317ce44c1ebc
Revision a1df45d0cb06e191243854dcb04a476136c3acc2 authored by Steven Johnson on 19 November 2021, 20:53:32 UTC, committed by Steven Johnson on 19 November 2021, 20:53:32 UTC
This is a sketch of a clunky-but-effective way to make some (simple) tests AOT-compiled without having to greatly increase number of source files or add lots of complex build rules. Not sure if it's a win or not -- opinions wanted. Basically, this puts a Generator and a 'main' test harness into the same file, separated by an ifdef; the CMake build rules know how to build the file multiple ways and connect them together.

I'm honestly torn as to whether the icky, please-don't-use-this-in-real-code approach here is outweighed by the convenience factor of having self-contained tests that will AOT-compile properly.

(BTW, this approach produces results that will build-and-run just fine under Wasm! Although the one example I've provided in this PR doesn't do so usefully, because it requires GPU support...)

Also note that I haven't provided build rules for Make (only CMake), and I don't intend to do so, because doing this in Make is a big mess of ugly special cases. Someone else can add new features to Make if they like.
1 parent cfd03c9
History
Tip revision: 4e0b313fa7f6d3897f960dd322cfd13daed97c98 authored by Andrew Adams on 18 April 2024, 19:48:59 UTC
Rewrite IREquality to use a more compact stack instead of deep recursion (#8198)
Tip revision: 4e0b313
File Mode Size
.github
apps
cmake
dependencies
doc
packaging
python_bindings
src
test
tools
tutorial
util
.clang-format -rw-r--r-- 1.4 KB
.clang-format-ignore -rw-r--r-- 265 bytes
.clang-tidy -rw-r--r-- 1.8 KB
.gitattributes -rw-r--r-- 342 bytes
.gitignore -rw-r--r-- 1.1 KB
.gitmodules -rw-r--r-- 0 bytes
CMakeLists.txt -rw-r--r-- 5.5 KB
CMakePresets.json -rw-r--r-- 5.2 KB
CODE_OF_CONDUCT.md -rw-r--r-- 3.5 KB
LICENSE.txt -rw-r--r-- 3.2 KB
Makefile -rw-r--r-- 101.0 KB
README.md -rw-r--r-- 16.4 KB
README_cmake.md -rw-r--r-- 69.2 KB
README_rungen.md -rw-r--r-- 12.1 KB
README_webassembly.md -rw-r--r-- 8.4 KB
run-clang-format.sh -rwxr-xr-x 1.4 KB
run-clang-tidy.sh -rwxr-xr-x 3.2 KB

README.md

back to top