summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog20
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle1.C28
-rw-r--r--gcc/testsuite/g++.dg/mangle1.C28
-rw-r--r--gcc/testsuite/g++.dg/opt/vtgc1.C (renamed from gcc/testsuite/g++.dg/vtgc1.C)26
-rw-r--r--gcc/testsuite/gcc.dg/asm-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/asm-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/asm-fs-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/dll-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/dll-3.c4
-rw-r--r--gcc/testsuite/gcc.dg/dll-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/iftrap-1.c2
-rw-r--r--gcc/testsuite/lib/scanasm.exp51
12 files changed, 103 insertions, 72 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 995daaef832..add7b2c9d4d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,16 @@
+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
@@ -109,6 +122,13 @@ Mon Jul 16 12:21:56 2001 Nicola Pero <n.pero@mi.flashnet.it>
* 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,
diff --git a/gcc/testsuite/g++.dg/abi/mangle1.C b/gcc/testsuite/g++.dg/abi/mangle1.C
new file mode 100644
index 00000000000..ab377d13b4e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle1.C
@@ -0,0 +1,28 @@
+// 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\]" } }
diff --git a/gcc/testsuite/g++.dg/mangle1.C b/gcc/testsuite/g++.dg/mangle1.C
deleted file mode 100644
index 0fde91e762c..00000000000
--- a/gcc/testsuite/g++.dg/mangle1.C
+++ /dev/null
@@ -1,28 +0,0 @@
-// 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\]" } }
diff --git a/gcc/testsuite/g++.dg/vtgc1.C b/gcc/testsuite/g++.dg/opt/vtgc1.C
index 791e4ceb6b8..c50855529bb 100644
--- a/gcc/testsuite/g++.dg/vtgc1.C
+++ b/gcc/testsuite/g++.dg/opt/vtgc1.C
@@ -118,16 +118,16 @@ void x3 (Multivs1 *ii) { ii->f2();}
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" } }
diff --git a/gcc/testsuite/gcc.dg/asm-2.c b/gcc/testsuite/gcc.dg/asm-2.c
index 80396ae288b..5adee41b9c6 100644
--- a/gcc/testsuite/gcc.dg/asm-2.c
+++ b/gcc/testsuite/gcc.dg/asm-2.c
@@ -6,4 +6,4 @@ int f()
asm volatile ("foo%%bar" : : );
}
-/* { dg-final { scan-assembler asm-2.c "foo%bar" } } */
+/* { dg-final { scan-assembler "foo%bar" } } */
diff --git a/gcc/testsuite/gcc.dg/asm-3.c b/gcc/testsuite/gcc.dg/asm-3.c
index 5c6864777f1..e7db804c18a 100644
--- a/gcc/testsuite/gcc.dg/asm-3.c
+++ b/gcc/testsuite/gcc.dg/asm-3.c
@@ -6,4 +6,4 @@ int f()
asm ("foo%%bar");
}
-/* { dg-final { scan-assembler asm-3.c "foo%%bar" } } */
+/* { dg-final { scan-assembler "foo%%bar" } } */
diff --git a/gcc/testsuite/gcc.dg/asm-fs-1.c b/gcc/testsuite/gcc.dg/asm-fs-1.c
index 4c7c3e03329..c60187a7af5 100644
--- a/gcc/testsuite/gcc.dg/asm-fs-1.c
+++ b/gcc/testsuite/gcc.dg/asm-fs-1.c
@@ -10,5 +10,5 @@ void foo (void) {}
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" } } */
diff --git a/gcc/testsuite/gcc.dg/dll-1.c b/gcc/testsuite/gcc.dg/dll-1.c
index eb3b9b867f0..4ae1a0e1797 100644
--- a/gcc/testsuite/gcc.dg/dll-1.c
+++ b/gcc/testsuite/gcc.dg/dll-1.c
@@ -6,5 +6,5 @@ __declspec (dllimport) void imp ();
__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" } } */
diff --git a/gcc/testsuite/gcc.dg/dll-3.c b/gcc/testsuite/gcc.dg/dll-3.c
index 0f7818f1e5c..0be1f973025 100644
--- a/gcc/testsuite/gcc.dg/dll-3.c
+++ b/gcc/testsuite/gcc.dg/dll-3.c
@@ -12,5 +12,5 @@ __declspec (dllimport) int foo2 ();
__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)" } } */
diff --git a/gcc/testsuite/gcc.dg/dll-4.c b/gcc/testsuite/gcc.dg/dll-4.c
index b708790baa5..fec08fcbb60 100644
--- a/gcc/testsuite/gcc.dg/dll-4.c
+++ b/gcc/testsuite/gcc.dg/dll-4.c
@@ -10,5 +10,5 @@ int foo2 = 5;
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_" } } */
diff --git a/gcc/testsuite/gcc.dg/iftrap-1.c b/gcc/testsuite/gcc.dg/iftrap-1.c
index b37cfce9f43..b6abfc44e56 100644
--- a/gcc/testsuite/gcc.dg/iftrap-1.c
+++ b/gcc/testsuite/gcc.dg/iftrap-1.c
@@ -1,7 +1,7 @@
/* 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)
{
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 9720b381fa5..105da61c2f0 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -19,10 +19,16 @@
# 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
@@ -32,17 +38,18 @@ proc scan-assembler { testcase pattern args } {
}
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
@@ -52,16 +59,15 @@ proc scan-assembler-not { testcase pattern args } {
}
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
@@ -73,7 +79,10 @@ proc scan-assembler-dem { testcase pattern args } {
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
@@ -83,15 +92,14 @@ proc scan-assembler-dem { testcase pattern args } {
}
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
@@ -103,7 +111,10 @@ proc scan-assembler-dem-not { testcase pattern args } {
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
@@ -113,8 +124,8 @@ proc scan-assembler-dem-not { testcase pattern args } {
}
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"
}
}