Allow conditional lit tests in Subzero, based on build flags. Adds conditionality to lit tests in two ways: 1) Allows the use of "; REQUIRES: XXX" lines in lit tests. In this case, the tests defined by the file are only run if all REQUIRES are met. 2) Allows the conditional running of RUN commands, based on build flags. This comes in two subforms. There are predefined %ifX commands that run the command defined by remaining arguments, if the corresponding %X2i command is applicable. Alternatively, one can use %if with explicit '--att' arguments to define what conditions should be checked. In any case, unlike REQUIRES, the %if commands RUN all the time, but simply generate empty output, rather then output defined by the following command, if the condition is not met. These latter tests are useful when the same input is to be tested under different conditions, since the REQUIRES form does not allow this. Note that m2i, p2i, l2i, and lc2i are also conditionally controlled, so that they do nothing if the build did not construct the appropriate Subzero translator. This CL replaces https://codereview.chromium.org/644143002 BUG=None R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/659513005
diff --git a/src/IceTypes.def b/src/IceTypes.def index 19175f0..3d4c9b1 100644 --- a/src/IceTypes.def +++ b/src/IceTypes.def
@@ -15,6 +15,14 @@ #ifndef SUBZERO_SRC_ICETYPES_DEF #define SUBZERO_SRC_ICETYPES_DEF +#define TARGETARCH_TABLE \ + /* enum value, printable string */ \ + X(Target_X8632, "x86-32") \ + X(Target_X8664, "x86-64") \ + X(Target_ARM32, "arm32") \ + X(Target_ARM64, "arm64") \ +//#define X(tag, str) + #define ICETYPE_TABLE \ /* enum value, size, align, # elts, element type, printable string */ \ /* (size and alignment in bytes) */ \