• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂486e58b188c1b093a8f64d4b5cd11ff5c3514cb2 (tree)
時間2020-01-09 20:41:29
作者Alex Bennée <alex.bennee@lina...>
CommiterAlex Bennée

Log Message

tests/tcg: add user version of dumb-as-bricks semiconsole test

There are linux-user users of semihosting so we'd better check things
work for them as well.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Change Summary

差異

--- a/tests/tcg/aarch64/Makefile.target
+++ b/tests/tcg/aarch64/Makefile.target
@@ -32,4 +32,11 @@ run-plugin-semihosting-with-%:
3232 $(call strip-plugin,$<) 2> $<.err, \
3333 "$< on $(TARGET_NAME) with $*")
3434
35+AARCH64_TESTS += semiconsole
36+run-semiconsole: semiconsole
37+ $(call skip-test, $<, "MANUAL ONLY")
38+
39+run-plugin-semiconsole-with-%:
40+ $(call skip-test, $<, "MANUAL ONLY")
41+
3542 TESTS += $(AARCH64_TESTS)
--- a/tests/tcg/arm/Makefile.target
+++ b/tests/tcg/arm/Makefile.target
@@ -49,6 +49,25 @@ run-plugin-semihosting-with-%:
4949 $(call strip-plugin,$<) 2> $<.err, \
5050 "$< on $(TARGET_NAME) with $*")
5151
52+ARM_TESTS += semiconsole semiconsole-arm
53+
54+semiconsole: CFLAGS += -mthumb
55+run-semiconsole: semiconsole
56+ $(call skip-test, $<, "MANUAL ONLY")
57+
58+run-plugin-semiconsole-with-%:
59+ $(call skip-test, $<, "MANUAL ONLY")
60+
61+semiconsole-arm: CFLAGS += -marm
62+semiconsole-arm: semiconsole.c
63+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
64+
65+run-semiconsole-arm: semiconsole-arm
66+ $(call skip-test, $<, "MANUAL ONLY")
67+
68+run-plugin-semiconsole-arm-with-%:
69+ $(call skip-test, $<, "MANUAL ONLY")
70+
5271 TESTS += $(ARM_TESTS)
5372
5473 # On ARM Linux only supports 4k pages
--- /dev/null
+++ b/tests/tcg/arm/semiconsole.c
@@ -0,0 +1,27 @@
1+/*
2+ * linux-user semihosting console
3+ *
4+ * Copyright (c) 2019
5+ * Written by Alex Bennée <alex.bennee@linaro.org>
6+ *
7+ * SPDX-License-Identifier: GPL-3.0-or-later
8+ */
9+
10+#include <stdio.h>
11+#include <stdint.h>
12+#include "semicall.h"
13+
14+int main(void)
15+{
16+ char c;
17+
18+ printf("Semihosting Console Test\n");
19+ printf("hit X to exit:");
20+
21+ do {
22+ c = __semi_call(SYS_READC, 0);
23+ printf("got '%c'\n", c);
24+ } while (c != 'X');
25+
26+ return 0;
27+}