libjit.git - libjit

index : libjit.git
libjit
summary refs log tree commit diff
path: root/tests/unit/unit-tests.h
diff options
context:
space:
mode:
authorAleksey Demakov <ademakov@gmail.com>2020年01月09日 14:02:30 +0700
committerGitHub <noreply@github.com>2020年01月09日 14:02:30 +0700
commit77fbfeceaa7d0d20a3fbc38f00a8d3f85707e7a8 (patch)
tree9ea40c89d96f654c52c1a0c1990b01c97f58a0ab /tests/unit/unit-tests.h
parent5fba3155b029c577cdb59569f222ba2d2bef045e (diff)
parent6a7e6d9eb375a6e853a36b9193c40d702d77ff48 (diff)
downloadlibjit-77fbfeceaa7d0d20a3fbc38f00a8d3f85707e7a8.tar.gz
Merge pull request #19 from tromey/branch-optimize
Optimize a jump-around-branch case
Diffstat (limited to 'tests/unit/unit-tests.h')
-rw-r--r--tests/unit/unit-tests.h 41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/unit/unit-tests.h b/tests/unit/unit-tests.h
new file mode 100644
index 0000000..0a51189
--- /dev/null
+++ b/tests/unit/unit-tests.h
@@ -0,0 +1,41 @@
+/*
+ * unit-tests.h - Defines for unit tests.
+ *
+ * Copyright (C) 2020 Free Software Foundation
+ *
+ * This file is part of the libjit library.
+ *
+ * The libjit library is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation, either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * The libjit library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the libjit library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _JIT_TESTS_UNIT_TESTS_H
+#define _JIT_TESTS_UNIT_TESTS_H
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Convenience. */
+#include <jit/jit-dump.h>
+
+#define CHECK(val) \
+ do { \
+ if (!(val)) { \
+ fprintf (stderr, "%s:%d: error: test failure\n", \
+ __FILE__, __LINE__); \
+ exit (1); \
+ } \
+ } while (0)
+
+#endif /* _JIT_TESTS_UNIT_TESTS_H */
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月08日 09:22:28 +0000

AltStyle によって変換されたページ (->オリジナル) /