[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny created this revision. mgorny added reviewers: krytarowski, vitalybuka. Herald added subscribers: Sanitizers, llvm-commits, dberris, kubamracek. Add two new test cases that test the following stdio.h functions: - clearerr() - feof() - ferror() - fileno() - fgetc() - getc() - ungetc() Rep

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-28 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added inline comments. Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:7 +int main(int argc, char **argv) { + FILE *fp; + int fd; Please move local variable declaration to the first line used (whenever possible) ==

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-28 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:49 + + fclose(fp); + return 0; why does this close file only on success? I assume normal test behavior is return 0; So please replace all return N with as

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny marked 4 inline comments as done. mgorny added inline comments. Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:49 + + fclose(fp); + return 0; vitalybuka wrote: > why does this close file only on success? > I assume normal test be

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 179679. mgorny marked an inline comment as done. mgorny added a comment. Moved variable definitions, and added asserts. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56136/new/ https://reviews.llvm.org/D56136 Files: test/sanitizer_common/TestCases

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-29 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski accepted this revision. krytarowski added inline comments. This revision is now accepted and ready to land. Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:38 + + fclose(fp); + return 0; `assert(!fclose(fp));` =

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-29 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added inline comments. Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:38 + + fclose(fp); + return 0; krytarowski wrote: > `assert(!fclose(fp));` alternatively `!= EOF` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny added inline comments. Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:38 + + fclose(fp); + return 0; krytarowski wrote: > krytarowski wrote: > > `assert(!fclose(fp));` > alternatively `!= EOF` It will fail most likely, due to us

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. (Do you have another idea how to reliably trigger `ferror`?) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56136/new/ https://reviews.llvm.org/D56136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lis

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-29 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added inline comments. Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:38 + + fclose(fp); + return 0; mgorny wrote: > krytarowski wrote: > > krytarowski wrote: > > > `assert(!fclose(fp));` > > alternatively `!= EOF` > It will

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2018-12-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 179691. mgorny added a comment. Added asserts for `fclose()`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56136/new/ https://reviews.llvm.org/D56136 Files: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc test/sanitizer_common/TestC

[PATCH] D56136: [compiler-rt] [sanitizer_common] Add tests for more stdio.h functions

2019-01-02 Thread Michał Górny via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL350225: [sanitizer_common] Add tests for more stdio.h functions (authored by mgorny, committed by ). Herald added a subscriber: delcypher. Changed prior to commit: https://reviews.llvm.org/D56136?vs=179