This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make some ubsan tests more robust


On Mon, Mar 24, 2014 at 10:37:46AM +0100, Marek Polacek wrote:
> dg-output as it stands can't be used in a negate form, that is we can't
> check that no output was produced.  This is needed for ubsan: there
> are testcases that when run should issue no output at all.  We can,
> however, use this really ugly hack, where we output some fake stuff
> at the beginning and at the end of main() and check that nothing was
> issued in between.  And it's even uglier because I need to pull in
> <stdio.h> because of stderr...
> 
> Fortunately in 5.0 this will not be needed, because I'll implement
> the -fno-sanitize-recover option (then any runtime error causes the
> program to abort).
> 
> Ran ubsan testsuite.  Ok for trunk?
> 
> 2014-03-24  Marek Polacek  <polacek@redhat.com>
> 
> testsuite/
> 	* c-c++-common/ubsan/div-by-zero-4.c: Don't include limits.h.  Define
> 	INT_MIN.
> 	* c-c++-common/ubsan/overflow-1.c: Check for unwanted output.
> 	* c-c++-common/ubsan/overflow-add-1.c: Likewise.
> 	* c-c++-common/ubsan/overflow-mul-1.c: Likewise.
> 	* c-c++-common/ubsan/overflow-mul-3.c: Likewise.
> 	* c-c++-common/ubsan/overflow-negate-2.c: Likewise.
> 	* c-c++-common/ubsan/overflow-sub-1.c: Likewise.
> 	* c-c++-common/ubsan/pr59503.c: Likewise.
> 	* c-c++-common/ubsan/pr60613-1.c: Likewise.
> 	* c-c++-common/ubsan/save-expr-1.c: Likewise.
> 	* c-c++-common/ubsan/shift-3.c: Likewise.
> 	* c-c++-common/ubsan/shift-6.c: Likewise.
> 	* c-c++-common/ubsan/undefined-1.c: Likewise.
> 	* c-c++-common/ubsan/vla-2.c: Likewise.
> 	* c-c++-common/ubsan/vla-3.c: Likewise.
> 	* c-c++-common/ubsan/vla-4.c: Likewise.
> 	* g++.dg/ubsan/cxx11-shift-1.C: Likewise.
> 	* g++.dg/ubsan/return-2.C: Likewise.

Ok, thanks.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]