instantiate4.C: New test: -frepo does not generate needed virtual table

* g++.old-deja/g++.pt/instantiate4.C: New test: -frepo does not
	generate needed virtual table
	* lib/old-dejagnu.exp (old-dejagnu): support `Build then link:'

From-SVN: r22984
This commit is contained in:
Alexandre Oliva 1998-10-11 11:12:06 +00:00 committed by Alexandre Oliva
parent 7d384cc0b3
commit 0126020166
3 changed files with 51 additions and 1 deletions

View File

@ -1,3 +1,10 @@
1998-10-11 Alexandre Oliva <oliva@dcc.unicamp.br>
* g++.old-deja/g++.pt/instantiate4.C: New test: -frepo does not
generate needed virtual table
* lib/old-dejagnu.exp (old-dejagnu): support `Build then link:'
1998-10-10 Dariush Eslimi <eslimi@loran.com>
* g++.old-deja/g++.ext/typeof1.C: New test; typeof based on

View File

@ -0,0 +1,29 @@
// Build then link:
// Special g++ Options: -frepo -Werror
// Submitted by Melissa O'Neill <oneill@cs.sfu.ca>
// the vtable of Foo<int> wouldn't be generated
// excess errors test - XFAIL *-*-*
template <typename A>
struct Foo {
virtual void foo() {}
};
template <typename A>
struct Bar {
void bar();
};
template <typename A>
void Bar<A>::bar() {
Foo<A> oof;
}
int main () {
Bar<int> rab;
rab.bar();
}

View File

@ -196,7 +196,7 @@ proc old-dejagnu { compiler prog cflagsx default_cflags libs } {
# is right. If no such Special Options are found, $default_cflags is used.
# FIXME: Can there be multiple lines of these?
#
# Other keywords: "Build don't link:", "Build don't run:".
# Other keywords: "Build don't link:", "Build don't run:", "Build then link:".
set name "[file tail [file dirname $prog]]/[file tail $prog]"
@ -239,6 +239,15 @@ proc old-dejagnu { compiler prog cflagsx default_cflags libs } {
verbose "Will compile $prog to object" 3
}
set tmp [lindex [grep $prog "Build then link:"] 0]
if ![string match "" $tmp] then {
set compile_type "object"
set runflag 2
set final_output "$output"
set output "$tmpdir/[file tail [file rootname $prog]].o"
verbose "Will compile $prog to object, then link it" 3
}
set tmp [lindex [grep $prog "Build don.t run:"] 0]
if ![string match "" $tmp] then {
set runflag 0
@ -399,6 +408,11 @@ proc old-dejagnu { compiler prog cflagsx default_cflags libs } {
# we can't run a.out when the compilation fails.
remote_file build delete $output
set comp_output [${tool}_target_compile $prog $output $compile_type $cflags]
if { $runflag == 2 && [file exists $output] } then {
set runflag 0
set comp_output [concat $comp_output [${tool}_target_compile $output $final_output "executable" $cflags]]
set output $final_output
}
# Delete things like "ld.so: warning" messages.
set comp_output [prune_warnings $comp_output]