On Tue, Oct 29, 2013 at 07:56:32AM -0700, Andrew Pinski wrote: > * lib/ubsan-dg.exp (check_effective_target_fundefined_sanitizer): New > function. > (ubsan_init): Save off ALWAYS_CXXFLAGS. > (ubsan_finish): Restore ALWAYS_CXXFLAGS correctly. > * lib/asan-dg.exp (check_effective_target_faddress_sanitizer): Change > to creating an executable. > (asan_init): Save off ALWAYS_CXXFLAGS. > (asan_finish): Restore ALWAYS_CXXFLAGS correctly. > * gcc.dg/ubsan/ubsan.exp: Don't check the return value of ubsan_init. > Check check_effective_target_fundefined_sanitizer before running the > tests. > * g++.dg/ubsan/ubsan.exp: Likewise. > * testsuite/gcc.dg/asan/asan.exp: Don't check > check_effective_target_faddress_sanitizer too early. Don't check the > return value of asan_init. > * g++.dg/asan/asan.exp: Likewise.
Try to find out some mailer that doesn't eat tabs? Once you have tabs, some of the lines (at least the first one) will be too long. > --- testsuite/lib/ubsan-dg.exp (revision 204138) > +++ testsuite/lib/ubsan-dg.exp (working copy) > @@ -14,6 +14,15 @@ > # along with GCC; see the file COPYING3. If not see > # <http://www.gnu.org/licenses/>. > > +# Return 1 if compilation with -fsanitize=undefined is error-free for trivial > +# code, 0 otherwise. > + > +proc check_effective_target_fundefined_sanitizer {} { Please rename this to ..._fsanitize_undefined everywhere, and also *_faddress_sanitizer to *_fsanitize_address. The history behind the latter is that the option I think was initially -faddress-sanitizer and only later got renamed to the current form. > @@ -60,6 +69,7 @@ proc ubsan_init { args } { > global ALWAYS_CXXFLAGS > global TOOL_OPTIONS > global ubsan_saved_TEST_ALWAYS_FLAGS > + global usan_saved_ALWAYS_CXXFLAGS Please spell it as ubsan* instead of usan*. > --- testsuite/gcc.dg/asan/asan.exp (revision 204138) > +++ testsuite/gcc.dg/asan/asan.exp (working copy) > @@ -1,4 +1,4 @@ > -# Copyright (C) 2012-2013 Free Software Foundation, Inc. > +# Copyright (C) 2012 Free Software Foundation, Inc. Don't do this. > --- testsuite/g++.dg/asan/asan.exp (revision 204138) > +++ testsuite/g++.dg/asan/asan.exp (working copy) > @@ -1,4 +1,4 @@ > -# Copyright (C) 2012-2013 Free Software Foundation, Inc. > +# Copyright (C) 2012 Free Software Foundation, Inc. Nor this. Otherwise it looks good to me. There is tsan.exp that will probably need similar treatment though now. Jakub