+2001-07-24 Jason Merrill <jason_merrill@redhat.com>
+
+ * lib/scanasm.exp (scan-assembler*): Don't take "testcase" argument.
+ * gcc.dg/asm-2.c, gcc.dg/asm-3.c, gcc.dg/asm-fs-1.c, gcc.dg/dll-1.c,
+ gcc.dg/dll-3.c, gcc.dg/dll-4.c, gcc.dg/iftrap-1.c: Don't pass it.
+ * g++.dg/mangle1.C, g++.dg/vtgc1.C: Likewise.
+
+ * lib/prune.exp (prune_gcc_output): Prune "Please submit a full
+ bug report" message.
+
+ * g++.dg/dg.exp: Run tests from subdirectories other than "special".
+ * g++.dg/ext/instantiate1.C: Move from old-deja.
+
2001-07-24 David Billinghurst <David.Billinghurst@riotinto.com>
* g77.f-torture/execute/intrinsic-unix-bessel.f: New test
* g++.old-deja/g++.other/enum5.C: New test.
+2001-07-10 Jason Merrill <jason_merrill@redhat.com>
+
+ * lib/g++-dg.exp: Load file-format and target-supports like gcc.
+ (g++-dg-prune): Call prune_gcc_output.
+ * prune.exp: New file for prune_gcc_output.
+ * lib/g++.exp, lib/gcc.exp: Load it.
+
2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.c-torture/compile/20010701-1.c,
--- /dev/null
+// Test for mangling of simple testcase involving construction vtables.
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+struct A {
+ virtual void f () { }
+};
+
+struct B: public virtual A { };
+struct C: public B { };
+
+C c;
+
+// { dg-final { scan-assembler "\n_?_ZN1A1fEv\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZN1AC2Ev\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZN1BC2Ev\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZN1CC1Ev\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTC1C0_1B\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTI1A\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTI1B\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTI1C\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTS1A\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTS1B\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTS1C\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTT1C\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTV1A\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZTV1C\[: \t\n\]" } }
+++ /dev/null
-// Test for mangling of simple testcase involving construction vtables.
-
-// { dg-do compile }
-// { dg-options "-fno-inline" }
-
-struct A {
- virtual void f () { }
-};
-
-struct B: public virtual A { };
-struct C: public B { };
-
-C c;
-
-// { dg-final { scan-assembler mangle1.C "\n_?_ZN1A1fEv\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZN1AC2Ev\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZN1BC2Ev\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZN1CC1Ev\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZTC1C0_1B\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZTI1A\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZTI1B\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZTI1C\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZTS1A\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZTS1B\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZTS1C\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZTT1C\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZTV1A\[: \t\n\]" } }
-// { dg-final { scan-assembler mangle1.C "\n_?_ZTV1C\[: \t\n\]" } }
void x4 (Multiss2 *ii) { ii->f2();}
void x5 (Multivv3 *ii) { ii->f2();}
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multivv3, 0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for Multivv3, 0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multiss2, vtable for Base2" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multivs1, vtable for Base2" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for Multivs1, vtable for Base2" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multisv0, vtable for Side0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for Multisv0, vtable for Side0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Side0, 0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for VbasedA, 0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for VbasedA, 0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Base2, vtable for Base1" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Base1, vtable for Base0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Base0, 0" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multivv3, 0" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multivv3, 0" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multiss2, vtable for Base2" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multivs1, vtable for Base2" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multivs1, vtable for Base2" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multisv0, vtable for Side0" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multisv0, vtable for Side0" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Side0, 0" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for VbasedA, 0" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for VbasedA, 0" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base2, vtable for Base1" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base1, vtable for Base0" } }
+// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base0, 0" } }
asm volatile ("foo%%bar" : : );
}
-/* { dg-final { scan-assembler asm-2.c "foo%bar" } } */
+/* { dg-final { scan-assembler "foo%bar" } } */
asm ("foo%%bar");
}
-/* { dg-final { scan-assembler asm-3.c "foo%%bar" } } */
+/* { dg-final { scan-assembler "foo%%bar" } } */
extern int foobar asm ("_baz");
int foobar = 3;
-/* { dg-final { scan-assembler-not asm-fs-1.c "\\*_bar" } } */
-/* { dg-final { scan-assembler-not asm-fs-1.c "\\*_baz" } } */
+/* { dg-final { scan-assembler-not "\\*_bar" } } */
+/* { dg-final { scan-assembler-not "\\*_baz" } } */
__declspec (dllexport) void exp () { imp (); }
-/* { dg-final { scan-assembler dll-1.c "\.section\[ \t\]*.drectve\n\[^\n\]*-export:exp.*__imp_imp" } } */
-/* { dg-final { scan-assembler-not dll-1.c "__imp_exp" } } */
+/* { dg-final { scan-assembler "\.section\[ \t\]*.drectve\n\[^\n\]*-export:exp.*__imp_imp" } } */
+/* { dg-final { scan-assembler-not "__imp_exp" } } */
__declspec (dllexport) int foo1 () { return foo2 (); }
__declspec (dllexport) int foo2 () { return foo1 (); }
-/* { dg-final { scan-assembler dll-3.c "\.section\[ \t\]*\.drectve\n\[^\n\]*-export:foo1.*\.section\[ \t\]*\.drectve\n\[^\n\]*-export:foo2" } } */
-/* { dg-final { scan-assembler-not dll-3.c "(__imp_foo1|__imp_foo2)" } } */
+/* { dg-final { scan-assembler "\.section\[ \t\]*\.drectve\n\[^\n\]*-export:foo1.*\.section\[ \t\]*\.drectve\n\[^\n\]*-export:foo2" } } */
+/* { dg-final { scan-assembler-not "(__imp_foo1|__imp_foo2)" } } */
int f () { return foo1 + foo2; }
/* FIXME: We should scan the output of nm for this case. */
-/* { dg-final { scan-assembler dll-4.c "(foo2:.*\.comm\[ \t_\]*foo1)" } } */
-/* { dg-final { scan-assembler-not dll-4.c "__imp_" } } */
+/* { dg-final { scan-assembler "(foo2:.*\.comm\[ \t_\]*foo1)" } } */
+/* { dg-final { scan-assembler-not "__imp_" } } */
/* Verify that we optimize to conditional traps. */
/* { dg-options "-O" } */
/* { dg-do compile { target rs6000-*-* powerpc-*-* sparc*-*-* } } */
-/* { dg-final { scan-assembler-not iftrap-1.c "^\t(trap|ta)\[ \t\]" } } */
+/* { dg-final { scan-assembler-not "^\t(trap|ta)\[ \t\]" } } */
void f1(int p)
{
# Utility for scanning compiler result, invoked via dg-final.
# Call pass if pattern is present, otherwise fail.
-proc scan-assembler { testcase pattern args } {
- global subdir
+proc scan-assembler { pattern args } {
+ # This assumes that we are two frames down from dg-test, and that
+ # it still stores the filename of the testcase in a local variable "name".
+ # A cleaner solution would require a new dejagnu release.
+ set testcase [uplevel 2 { concat "$name" }]
- set fd [open [file rootname $testcase].s r]
+ # This must match the rule in gcc-dg.exp.
+ set output_file "[file rootname [file tail $testcase]].s"
+
+ set fd [open $output_file r]
set text [read $fd]
close $fd
}
if [regexp -- $pattern $text] {
- pass "$subdir/$testcase scan-assembler $vmessage"
+ pass "$testcase scan-assembler $vmessage"
} else {
- fail "$subdir/$testcase scan-assembler $vmessage"
+ fail "$testcase scan-assembler $vmessage"
}
}
# Call pass if pattern is not present, otherwise fail.
-proc scan-assembler-not { testcase pattern args } {
- global subdir
+proc scan-assembler-not { pattern args } {
+ set testcase [uplevel 2 { concat "$name" }]
+ set output_file "[file rootname [file tail $testcase]].s"
- set fd [open [file rootname $testcase].s r]
+ set fd [open $output_file r]
set text [read $fd]
close $fd
}
if ![regexp -- $pattern $text] {
- pass "$subdir/$testcase scan-assembler-not $vmessage"
+ pass "$testcase scan-assembler-not $vmessage"
} else {
- fail "$subdir/$testcase scan-assembler-not $vmessage"
+ fail "$testcase scan-assembler-not $vmessage"
}
}
# Utility for scanning demangled compiler result, invoked via dg-final.
# Call pass if pattern is present, otherwise fail.
-proc scan-assembler-dem { testcase pattern args } {
- global subdir
+proc scan-assembler-dem { pattern args } {
global cxxfilt
global base_dir
verbose -log "c++filt is $cxxfilt"
}
- set fd [open "| $cxxfilt < [file rootname $testcase].s" r]
+ set testcase [uplevel 2 { concat "$name" }]
+ set output_file "[file rootname [file tail $testcase]].s"
+
+ set fd [open "| $cxxfilt < $output_file" r]
set text [read $fd]
close $fd
}
if [regexp -- $pattern $text] {
- pass "$subdir/$testcase scan-assembler $vmessage"
+ pass "$testcase scan-assembler $vmessage"
} else {
- fail "$subdir/$testcase scan-assembler $vmessage"
+ fail "$testcase scan-assembler $vmessage"
}
}
# Call pass if demangled pattern is not present, otherwise fail.
-proc scan-assembler-dem-not { testcase pattern args } {
- global subdir
+proc scan-assembler-dem-not { pattern args } {
global cxxfilt
global base_dir
verbose -log "c++filt is $cxxfilt"
}
- set fd [open "| $cxxfilt < [file rootname $testcase].s" r]
+ set testcase [uplevel 2 { concat "$name" }]
+ set output_file "[file rootname [file tail $testcase]].s"
+
+ set fd [open "| $cxxfilt < $output_file" r]
set text [read $fd]
close $fd
}
if ![regexp -- $pattern $text] {
- pass "$subdir/$testcase scan-assembler-not $vmessage"
+ pass "$testcase scan-assembler-not $vmessage"
} else {
- fail "$subdir/$testcase scan-assembler-not $vmessage"
+ fail "$testcase scan-assembler-not $vmessage"
}
}