X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=qemu%2Ftests%2Ftcg%2Fopenrisc%2Ftest_divu.c;fp=qemu%2Ftests%2Ftcg%2Fopenrisc%2Ftest_divu.c;h=bff9e3ea590b408d700a880939bd2624c111f2fb;hb=e44e3482bdb4d0ebde2d8b41830ac2cdb07948fb;hp=0000000000000000000000000000000000000000;hpb=9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00;p=kvmfornfv.git diff --git a/qemu/tests/tcg/openrisc/test_divu.c b/qemu/tests/tcg/openrisc/test_divu.c new file mode 100644 index 000000000..bff9e3ea5 --- /dev/null +++ b/qemu/tests/tcg/openrisc/test_divu.c @@ -0,0 +1,34 @@ +#include + +int main(void) +{ + int a, b, c; + int result; + + b = 0x120; + c = 0x4; + result = 0x48; + + __asm + ("l.divu %0, %1, %2\n\t" + : "=r"(a) + : "r"(b), "r"(c) + ); + if (a != result) { + printf("divu error\n"); + return -1; + } + + result = 0x4; + __asm + ("l.divu %0, %1, %0\n\t" + : "+r"(a) + : "r"(b) + ); + if (a != result) { + printf("divu error\n"); + return -1; + } + + return 0; +}