From d901eff3e6da96d34be33b307aa6cea75098c180 Mon Sep 17 00:00:00 2001 From: Jia Liu Date: Fri, 20 Jul 2012 15:50:53 +0800 Subject: target-or32: Add testcases Add testcases for OpenRISC. Signed-off-by: Jia Liu Signed-off-by: Blue Swirl --- tests/tcg/openrisc/test_lf_sub.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/tcg/openrisc/test_lf_sub.c (limited to 'tests/tcg/openrisc/test_lf_sub.c') diff --git a/tests/tcg/openrisc/test_lf_sub.c b/tests/tcg/openrisc/test_lf_sub.c new file mode 100644 index 0000000000..5ee9b03910 --- /dev/null +++ b/tests/tcg/openrisc/test_lf_sub.c @@ -0,0 +1,35 @@ +#include + +int main(void) +{ + float a, b, c; + float result; + + b = 10.5; + c = 1.5; + result = 9.0; + __asm + ("lf.sub.s %0, %1, %2\n\t" + : "=r"(a) + : "r"(b), "r"(c) + ); + if (a != result) { + printf("lf.sub.s error\n"); + return -1; + } + +/* b = 0x999; + c = 0x654; + result = 0x345; + __asm + ("lf.sub.d %0, %1, %2\n\t" + : "=r"(a) + : "r"(b), "r"(c) + ); + if (a != result) { + printf("lf.sub.d error\n"); + return -1; + }*/ + + return 0; +} -- cgit v1.2.3