@@ -1,3 +1,5 @@
+tests = $(TEST_DIR)/selftest.elf
+
all: directories test_cases
test_cases: $(tests)
new file mode 100644
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2017 Red Hat Inc
+ *
+ * Authors:
+ * Thomas Huth <thuth@redhat.com>
+ * David Hildenbrand <david@redhat.com>
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+#include <libcflat.h>
+#include <util.h>
+
+static void test_fp(void)
+{
+ double a = 3.0;
+ double b = 2.0;
+ double c;
+
+ asm volatile(
+ " ddb %1, %2\n"
+ " std %1, %0\n"
+ : "=m" (c) : "f" (a), "m" (b));
+
+ report("3.0/2.0 == 1.5", c == 1.5);
+}
+
+int main(int argc, char**argv)
+{
+ report_prefix_push("selftest");
+
+ report("true", true);
+ report("argc == 3", argc == 3);
+ report("argv[0] == PROGNAME", !strcmp(argv[0], "s390x/selftest.elf"));
+ report("argv[1] == test", !strcmp(argv[1], "test"));
+ report("argv[2] == 123", !strcmp(argv[2], "123"));
+
+ test_fp();
+
+ return report_summary();
+}
@@ -17,3 +17,8 @@
# # to check separated by a space but each check
# # parameter needs to be of the form <path>=<value>
##############################################################################
+
+[selftest-setup]
+file = selftest.elf
+groups = selftest
+extra_params = -append 'test 123'
Test if the general infrastructure is working. The test will fail until we have proper sclp console output. Signed-off-by: David Hildenbrand <david@redhat.com> --- s390x/Makefile | 2 ++ s390x/selftest.c | 41 +++++++++++++++++++++++++++++++++++++++++ s390x/unittests.cfg | 5 +++++ 3 files changed, 48 insertions(+) create mode 100644 s390x/selftest.c