From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19247 invoked by alias); 9 Jul 2004 19:51:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 19236 invoked from network); 9 Jul 2004 19:51:30 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 9 Jul 2004 19:51:30 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i69JpUe1016735 for ; Fri, 9 Jul 2004 15:51:30 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i69JpU002474 for ; Fri, 9 Jul 2004 15:51:30 -0400 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id i69JpUvU022923 for ; Fri, 9 Jul 2004 15:51:30 -0400 Received: from toenail (toenail.toronto.redhat.com [172.16.14.211]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 07169800419 for ; Fri, 9 Jul 2004 15:51:30 -0400 (EDT) Received: from toenail.toronto.redhat.com (localhost.localdomain [127.0.0.1]) by toenail (8.12.10/8.12.5) with ESMTP id i69JpTxj005254 for ; Fri, 9 Jul 2004 15:51:29 -0400 Received: (from fche@localhost) by toenail.toronto.redhat.com (8.12.10/8.12.10/Submit) id i69JpTvt005252 for gcc-patches@gcc.gnu.org; Fri, 9 Jul 2004 15:51:29 -0400 Date: Fri, 09 Jul 2004 21:07:00 -0000 From: "Frank Ch. Eigler" To: gcc-patches@gcc.gnu.org Subject: [mudflap] test case for c++ mudflap bug Message-ID: <20040709195129.GA5232@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-SW-Source: 2004-07/txt/msg01000.txt.bz2 Hi - The following patch adds a test case for bug g++/15861. > 2004-07-09 Frank Ch. Eigler > > Test case for g++/15861 > * testsuite/libmudflap.c++/ctors-[12].cxx: New test case halves. > * testsuite/libmudflap.c++/ctors.exp: Driver. > * testsuite/libmudflap.c++/c++frags.exp: Elide redundant default. > Look only for *frag* test cases. Index: testsuite/libmudflap.c++/c++frags.exp =================================================================== RCS file: /cvs/gcc/gcc/libmudflap/testsuite/libmudflap.c++/c++frags.exp,v retrieving revision 1.4 diff -r1.4 c++frags.exp 9c9 < foreach srcfile [lsort [glob -nocomplain ${srcdir}/libmudflap.c++/*.cxx]] { --- > foreach srcfile [lsort [glob -nocomplain ${srcdir}/libmudflap.c++/*frag.cxx]] { 11c11 < setenv MUDFLAP_OPTIONS "-no-heur-proc-map -viol-segv" --- > setenv MUDFLAP_OPTIONS "-viol-segv" Index: testsuite/libmudflap.c++/ctors-1.cxx =================================================================== RCS file: testsuite/libmudflap.c++/ctors-1.cxx diff -N testsuite/libmudflap.c++/ctors-1.cxx 0a1,20 > #include > > > extern char k []; > > class foo > { > public: > foo (char *m) { m [40] = 20; } > }; > > > foo f1 (k); > foo f2 (k); > foo f3 (k); > > int main () > { > return 0; > } Index: testsuite/libmudflap.c++/ctors-2.cxx =================================================================== RCS file: testsuite/libmudflap.c++/ctors-2.cxx diff -N testsuite/libmudflap.c++/ctors-2.cxx 0a1 > char k [500]; Index: testsuite/libmudflap.c++/ctors.exp =================================================================== RCS file: testsuite/libmudflap.c++/ctors.exp diff -N testsuite/libmudflap.c++/ctors.exp 0a1,42 > > libmudflap-init c++ > > dg-init > > global srcdir subdir > > foreach flags [list {} {-static} {-O2} {-O3}] { > set l1 [libmudflap_target_compile "$srcdir/$subdir/ctors-1.cxx" "ctors-1.o" object {additional_flags=-fmudflap}] > set test "ctors-1 compilation ${flags}" > if [string match "*mudflap cannot track lifetime of*k*" $l1] { pass $test } { fail $test } > > set l2 [libmudflap_target_compile "$srcdir/$subdir/ctors-2.cxx" "ctors-2.o" object {additional_flags=-fmudflap}] > set test "ctors-2 compilation ${flags}" > if [string match "" $l2] { pass $test } { fail $test } > > set l3 [libmudflap_target_compile "ctors-1.o ctors-2.o" "ctors-12.exe" executable {additional_flags=-fmudflap additional_flags=-lmudflap additional_flags=-lstdc++}] > set test "ctors-12 linkage ${flags}" > if [string match "" $l3] { pass $test } { fail $test } > > set l4 [libmudflap_target_compile "ctors-2.o ctors-1.o" "ctors-21.exe" executable {additional_flags=-fmudflap additional_flags=-lmudflap additional_flags=-lstdc++}] > set test "ctors-21 linkage ${flags}" > if [string match "" $l3] { pass $test } { fail $test } > > setenv MUDFLAP_OPTIONS "-viol-segv" > > remote_spawn host "./ctors-12.exe" > set l5 [remote_wait host 10] > set test "ctors-12 execution ${flags}" > if {[lindex $l5 0] == 0} { pass $test } { fail $test } > > remote_spawn host "./ctors-21.exe" > set l6 [remote_wait host 10] > set test "ctors-21 execution ${flags}" > if {[lindex $l6 0] == 0} { pass $test } { fail $test } > > foreach f [glob -nocomplain "ctors-*"] { > remote_file build delete $f > } > } > > dg-finish