Check CPU features in the Assembler.
Now, when the Assembler is asked to assemble an instruction, it asserts (in
debug mode) that the necessary features are available.
This also updates the tests to use no features by default, so that they must be
explicitly requested in the test itself. This provides some assurance that the
Assembler contains reasonable checks.
This patch uses variadic macros, which are a C99/C++11 feature, and I had to
silence a warning in the build system for C++98 builds. However, its use is
restricted to the tests, and we already rely on some other C99 features.
Change-Id: Ifb9846504f98c6d0912f60ff25f219ce2b780755
diff --git a/src/cpu-features.h b/src/cpu-features.h
index 649e46c..a0475cc 100644
--- a/src/cpu-features.h
+++ b/src/cpu-features.h
@@ -90,8 +90,8 @@
// A representation of the set of features known to be supported by the target
// device. Each feature is represented by a simple boolean flag.
//
-// - TODO: When the Assembler is asked to assemble an instruction, it should
-// assert (in debug mode) that the necessary features are available.
+// - When the Assembler is asked to assemble an instruction, it asserts (in
+// debug mode) that the necessary features are available.
//
// - TODO: The Simulator assumes that all features are available by default,
// but it should be possible to configure it to either warn or fail if the