Hi! On Mon, 23 Nov 2015 15:16:12 -0500, Nathan Sidwell <[email protected]> wrote: > The gcc.dg/sso tests gratuitously fail on PTX because they use IO facilities > that don't exist there. This patch changes the dumping to use the putchar > function call (and not a macro), and not use fputs.
> void put (const char s[])
> {
> +#ifdef __nvptx__
> + int i;
> + for (i = 0; s[i]; i++)
> + putchar (s[i]);
> +#else
> fputs (s, stdout);
> +#endif
> }
Doesn't __builtin_printf work?
More generally, I've been wondering before, whether we should improve the
I/O support in nvptx' newlib. I suppose (but have not verified) that the
_stdout member of _REENT (struct _reent) will by default be initilized to
&__sf_fake_stdout (and similar for stderr), which we could detect in
nvptx I/O functions, and in such cases use the PTX printf function. Or
something along these lines.
Grüße
Thomas
signature.asc
Description: PGP signature
