GSoC 2019: POSIX Compliance - FENV Environment probably not working properly in RISCV

Vaibhav Gupta vaibhavgupta40 at gmail.com
Sun Aug 11 15:48:49 UTC 2019


Configure command I used to build BSP:
==============================================
$ /home/varodek/development/rtems/kernel/rtems/configure
--prefix=/home/varodek/development/rtems/5 --enable-maintainer-mode
--target=riscv-rtems5 --enable-rtemsbsp=rv32imac --enable-tests
--enable-posix --disable-networking --enable-cxx RISCV_ENABLE_HTIF_SUPPORT=1
==============================================
.
.
.
.
Qemu command I used to run test:
==============================================
$ qemu-system-riscv32 -no-reboot -nographic -machine virt -m 256M -kernel
psxfenv01.exe
==============================================
.
.
.
.
Makefile.am
==============================================
+ if TEST_psxfenv01
+ psx_tests += psxfenv01
+ psxfenv01_SOURCES = psxfenv01/init.c
+ psxfenv01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxfenv01) \
+       $(support_includes)
+ psxfenv01_LDADD = -lm $(LDADD)
+ endif
+
==============================================

On Sun, Aug 11, 2019 at 8:36 PM Vaibhav Gupta <vaibhavgupta40 at gmail.com>
wrote:

> My code of testsuite:
> ===============================================
>   /* Test 'FE_DIVBYZERO' */
>   puts( "\nDivide by zero and confirm fetestexcept()." );
>   a = 0.0;
>   b = 1.0;
>   c = b/a;
>   printf("\n%d",FE_DIVBYZERO);
>   fegetexceptflag(&excepts,FE_ALL_EXCEPT);
>   printf("\n%d",excepts);
>   r = feraiseexcept(FE_DIVBYZERO);
>   printf("\n%d\n",r);
>   rtems_test_assert( fetestexcept( FE_DIVBYZERO ) );
> ==============================================
> OUTPUT
> ==============================================
> Divide by zero and confirm fetestexcept().
>
> 8
> 0
> 1
> /home/varodek/development/rtems/kernel/rtems/c/src/../../testsuites/psxtests/psxfenv01/init.c:
> 84 fetestexcept( FE_DIVBYZERO )
> ==============================================
> EXPECTED OUTPUT
> ==============================================
> Divide by zero and confirm fetestexcept().
>
> 8
> 8
> 0
> ==============================================
> - fetestexcept( FE_DIVBYZERO ), should return a non-zero value as
> division-by-zero was performed.
> .
> - feraiseexcept(FE_DIVBYZERO); is also not working. It should return zero
> when successful
> .
> ==============================================
>
> Thank You
> Vaibhav Gupta
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20190811/bbc13d43/attachment-0002.html>


More information about the devel mailing list