Re: [PATCH 3/4] selftests/nolibc: add abs() range test
From: Thomas Weißschuh
Date: Mon Jul 27 2026 - 12:28:32 EST
On 2026-07-27 09:01:09+0700, Ammar Faizi wrote:
> On 7/27/26 8:32 AM, Ammar Faizi wrote:
> > On 7/27/26 3:00 AM, Thomas Weißschuh wrote:
> > > We have _NOLIBC_OPTIMIZER_HIDE_VAR() for this.
> >
> > Oh, I missed it.
> >
> > > Maybe it can be made variadic.
>
> Oh wait, tools/testing/selftests/nolibc/nolibc-test.c is compiled
> twice. One for libc, one for nolibc. The test cannot use
> _NOLIBC_OPTIMIZER_HIDE_VAR(), it breaks libc:
Good point.
> ```
> $ make -f Makefile.nolibc run-libc-test
> nolibc-test.c: In function ‘test_abs_range’:
> nolibc-test.c:1756:9: error: implicit declaration of function ‘_NOLIBC_OPTIMIZER_HIDE_VAR’ [-Wimplicit-function-declaration]
> 1756 | _NOLIBC_OPTIMIZER_HIDE_VAR(ll, l, i);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~
> make: *** [Makefile.nolibc:278: libc-test] Error 1
> ```
>
> What approach do you prefer?
Do we need to hide the variables for a regular libc?
If not, we can have a dummy definition of _NOLIBC_OPTIMIZER_HIDE_VAR().
Thomas