aboutsummaryrefslogtreecommitdiff
path: root/libmudflap
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2004-07-09 19:51:51 +0000
committerFrank Ch. Eigler <fche@gcc.gnu.org>2004-07-09 19:51:51 +0000
commitb984b4bfa5a88cfc5bd05ad969287d6256f88a3e (patch)
tree592bc95ef11d7a025eaaa1012ee19ac150dec14c /libmudflap
parent999a1ad4ec7212dc6ac0217750bcbbf86518c7db (diff)
downloadgcc-b984b4bfa5a88cfc5bd05ad969287d6256f88a3e.zip
gcc-b984b4bfa5a88cfc5bd05ad969287d6256f88a3e.tar.gz
gcc-b984b4bfa5a88cfc5bd05ad969287d6256f88a3e.tar.bz2
Test case for g++/15861
2004-07-09 Frank Ch. Eigler <fche@redhat.com> 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. From-SVN: r84392
Diffstat (limited to 'libmudflap')
-rw-r--r--libmudflap/ChangeLog8
-rw-r--r--libmudflap/testsuite/libmudflap.c++/c++frags.exp4
-rw-r--r--libmudflap/testsuite/libmudflap.c++/ctors-1.cxx20
-rw-r--r--libmudflap/testsuite/libmudflap.c++/ctors-2.cxx1
-rw-r--r--libmudflap/testsuite/libmudflap.c++/ctors.exp42
5 files changed, 73 insertions, 2 deletions
diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog
index 04ce472..804359a 100644
--- a/libmudflap/ChangeLog
+++ b/libmudflap/ChangeLog
@@ -1,3 +1,11 @@
+2004-07-09 Frank Ch. Eigler <fche@redhat.com>
+
+ 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.
+
2004-07-08 Frank Ch. Eigler <fche@redhat.com>
ANSI C conversion, libmudflap specialization, recursion limiting.
diff --git a/libmudflap/testsuite/libmudflap.c++/c++frags.exp b/libmudflap/testsuite/libmudflap.c++/c++frags.exp
index 43da3bd..5eb69aa 100644
--- a/libmudflap/testsuite/libmudflap.c++/c++frags.exp
+++ b/libmudflap/testsuite/libmudflap.c++/c++frags.exp
@@ -6,9 +6,9 @@ dg-init
global srcdir
foreach flags [list {} {-static} {-O2} {-O3}] {
- foreach srcfile [lsort [glob -nocomplain ${srcdir}/libmudflap.c++/*.cxx]] {
+ foreach srcfile [lsort [glob -nocomplain ${srcdir}/libmudflap.c++/*frag.cxx]] {
set bsrc [file tail $srcfile]
- setenv MUDFLAP_OPTIONS "-no-heur-proc-map -viol-segv"
+ setenv MUDFLAP_OPTIONS "-viol-segv"
dg-runtest $srcfile $flags "-fmudflap -lmudflap"
}
}
diff --git a/libmudflap/testsuite/libmudflap.c++/ctors-1.cxx b/libmudflap/testsuite/libmudflap.c++/ctors-1.cxx
new file mode 100644
index 0000000..7717c80
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.c++/ctors-1.cxx
@@ -0,0 +1,20 @@
+#include <iostream>
+
+
+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;
+}
diff --git a/libmudflap/testsuite/libmudflap.c++/ctors-2.cxx b/libmudflap/testsuite/libmudflap.c++/ctors-2.cxx
new file mode 100644
index 0000000..c1a5019
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.c++/ctors-2.cxx
@@ -0,0 +1 @@
+char k [500];
diff --git a/libmudflap/testsuite/libmudflap.c++/ctors.exp b/libmudflap/testsuite/libmudflap.c++/ctors.exp
new file mode 100644
index 0000000..a160bc9
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.c++/ctors.exp
@@ -0,0 +1,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