summary refs log tree commit diff stats
path: root/tests/tcg/tricore/c/testdev_assert.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tcg/tricore/c/testdev_assert.h')
-rw-r--r--tests/tcg/tricore/c/testdev_assert.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/tcg/tricore/c/testdev_assert.h b/tests/tcg/tricore/c/testdev_assert.h
new file mode 100644
index 0000000000..ccd14f5025
--- /dev/null
+++ b/tests/tcg/tricore/c/testdev_assert.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2023 Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
+ *
+ * This code is licensed under the GPL version 2 or later. See the
+ * COPYING file in the top-level directory.
+ */
+
+int *testdev = (int *)0xf0000000;
+
+#define FAIL 1
+static inline void testdev_assert(int condition)
+{
+    if (!condition) {
+        *testdev = FAIL;
+        asm("debug");
+    }
+}
+