Someone who understands meson and gtest could do something much nicer,
but for now let's just stuff some assertions into debug builds of the
standalone compiler and call it a day...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8723>
bblock->scheduled = true;
}
}
+
+#ifndef NDEBUG
+int bi_test_scheduler(void)
+{
+ return 0;
+}
+#endif
*/
#include "disassemble.h"
+#include "compiler.h"
#include "main/mtypes.h"
#include "compiler/glsl/standalone.h"
free(code);
}
+static int
+bi_tests()
+{
+#ifndef NDEBUG
+ bi_test_scheduler();
+ printf("Pass.\n");
+ return 0;
+#else
+ printf("Tests omitted in release mode.");
+ return 1;
+#endif
+}
+
int
main(int argc, char **argv)
{
disassemble(argv[2], false);
else if (strcmp(argv[1], "disasm-verbose") == 0)
disassemble(argv[2], true);
+ else if (strcmp(argv[1], "test") == 0)
+ bi_tests();
else
unreachable("Unknown command. Valid: compile/disasm");
void bi_schedule(bi_context *ctx);
void bi_register_allocate(bi_context *ctx);
+/* Test suite */
+int bi_test_scheduler(void);
+
bi_clause *
bi_singleton(void *memctx, bi_instr *ins,
bi_block *block,