This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer_common] Add tests for more *putc and *getc variants
ClosedPublic

Authored by mgorny on Dec 29 2018, 10:32 AM.

Details

Summary

Add tests for the more character-oriented functions, that is:

  • fputc(), putc() and putchar()
  • getc_unlocked()
  • putc_unlocked() and putchar_unlocked()

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny created this revision.Dec 29 2018, 10:32 AM

Are all the functions available for FreeBSD, NetBSD, Linux, Android, Solaris an Darwin?

I would include a test for getchar_unlocked() anyway, even if it's an alias in most/all implementations.

Does this depend on D56109?

It looks like we shall install interceptors for a lot of routines that are FILE* users.

Are all the functions available for FreeBSD, NetBSD, Linux, Android, Solaris an Darwin?

I don't know. I suppose the easiest way to check would be to commit it and see what happens. Then address the fallout.

I would include a test for getchar_unlocked() anyway, even if it's an alias in most/all implementations.

I suppose I could do that but I'd have to pipe some data into the stdin.

krytarowski accepted this revision.Dec 29 2018, 2:30 PM

Are all the functions available for FreeBSD, NetBSD, Linux, Android, Solaris an Darwin?

I don't know. I suppose the easiest way to check would be to commit it and see what happens. Then address the fallout.

I would include a test for getchar_unlocked() anyway, even if it's an alias in most/all implementations.

I suppose I could do that but I'd have to pipe some data into the stdin.

OK, so let's do it in another test.

Please drop its mention in description.

This revision is now accepted and ready to land.Dec 29 2018, 2:30 PM
mgorny updated this revision to Diff 179711.Dec 29 2018, 2:48 PM
mgorny retitled this revision from [sanitizer_common] Add tests for remaining *putc and *getc variants to [sanitizer_common] Add tests for more *putc and *getc variants.
mgorny edited the summary of this revision. (Show Details)

Updated description.

This revision was automatically updated to reflect the committed changes.