+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
--- /dev/null
+// 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();
+}
# 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]"
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
# 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]