summaryrefslogtreecommitdiff
path: root/tests/xsthammer/generate.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-07-03 11:19:18 +0200
committerClifford Wolf <clifford@clifford.at>2013-07-03 11:19:18 +0200
commit28539541edc2df0c5e27034281cc20fe92ccb699 (patch)
treeb4f916504f5ab623123c6a54ab09e3db7ae0fef9 /tests/xsthammer/generate.cc
parenta5fe2565b72c3e80f981a9694072233876bf7c9a (diff)
Progress in xsthammer
Diffstat (limited to 'tests/xsthammer/generate.cc')
-rw-r--r--tests/xsthammer/generate.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/xsthammer/generate.cc b/tests/xsthammer/generate.cc
index 672ad86a..6efd4c97 100644
--- a/tests/xsthammer/generate.cc
+++ b/tests/xsthammer/generate.cc
@@ -4,7 +4,7 @@
#define GENERATE_TERNARY_OPS
#define GENERATE_CONCAT_OPS
#undef GENERATE_REPEAT_OPS // disabled because of XST bug
-#undef GENERATE_EXPRESSIONS
+#define GENERATE_EXPRESSIONS
#include <sys/stat.h>
#include <sys/types.h>
@@ -109,8 +109,7 @@ void print_expression(FILE *f, int budget, uint32_t mask = 0)
do {
mode = xorshift32() % num_modes;
} while (((1 << mode) & mask) == 0);
-
- fprintf(f, "/* %d */", mode);
+ // fprintf(f, "/* %d */", mode);
budget--;
switch (mode)
@@ -123,7 +122,13 @@ void print_expression(FILE *f, int budget, uint32_t mask = 0)
case 1:
fprintf(f, "(");
print_expression(f, budget/2, mask);
+ #if 1
+ // FIXME: relational operators disabled because there is an xst bug..
+ do k = xorshift32() % num_binary_ops; while ((k >= 9 && k <= 12) || (k >= 3 && k <= 6));
+ fprintf(f, "%s", binary_ops[k]);
+ #else
fprintf(f, "%s", binary_ops[xorshift32() % num_binary_ops]);
+ #endif
print_expression(f, budget/2, mask);
fprintf(f, ")");
break;