This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] PR c++/38699
On Mon, Nov 02, 2009 at 11:25:35PM -0500, Jason Merrill wrote:
>> * g++.dg/other/offsetof6.C: New test.
>> * gcc.dg/torture/builtin-offsetof.c: Likewise.
>
> Rather than have two identical tests, just put one copy in c-c++-common.
> OK with that change.
Thanks.
I committed that change to c-c++-common in trunk and 4.4, but then it
appeared that I need to port some changed to some *.exp file so that the
tests in c-c++-common are executed in the 4.4 branch.
I guess I'll have to do that for 4.3 as well.
Here is the porting patch I have tested for 4.4.
Is it OK for that branch ? I am going to post a similar change for 4.3
soon.
Dodji
commit b922cf99e563a2f02aadb4dcf9f72b86e4f2b664
Author: Dodji Seketeli <dodji@redhat.com>
Date: Tue Nov 3 12:56:39 2009 +0100
Port c-c++-common support from trunk to 4.4
gcc/testsuite/g++.dg/dg.exp: port c-c++-common support from trunk.
gcc/testsuite/gcc.dg/dfp/dfp.exp: Likewise.
gcc/testsuite/gcc.dg/dg.exp: Likewise.
gcc/testsuite/lib/target-supports.exp: Likewise.
diff --git a/gcc/testsuite/g++.dg/dg.exp b/gcc/testsuite/g++.dg/dg.exp
index 86565a9..7303256 100644
--- a/gcc/testsuite/g++.dg/dg.exp
+++ b/gcc/testsuite/g++.dg/dg.exp
@@ -48,5 +48,9 @@ set tests [prune $tests $srcdir/$subdir/graphite/*]
# Main loop.
dg-runtest $tests "" $DEFAULT_CXXFLAGS
+# C/C++ common tests.
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/*.\[cSi\]]] \
+ "" ""
+
# All done.
dg-finish
diff --git a/gcc/testsuite/gcc.dg/dfp/dfp.exp b/gcc/testsuite/gcc.dg/dfp/dfp.exp
index 2619a94..090194f 100644
--- a/gcc/testsuite/gcc.dg/dfp/dfp.exp
+++ b/gcc/testsuite/gcc.dg/dfp/dfp.exp
@@ -46,10 +46,14 @@ if ![info exists DEFAULT_CFLAGS] then {
# Initialize `dg'.
dg-init
-# Main loop.
+# Main loop; run the C-only tests.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
"" $DEFAULT_CFLAGS
+# Run the tests that are shared with C++ testing.
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/dfp/*c]] \
+ "" $DEFAULT_CFLAGS
+
# All done.
dg-finish
diff --git a/gcc/testsuite/gcc.dg/dg.exp b/gcc/testsuite/gcc.dg/dg.exp
index 8526c58..3f71178 100644
--- a/gcc/testsuite/gcc.dg/dg.exp
+++ b/gcc/testsuite/gcc.dg/dg.exp
@@ -32,5 +32,9 @@ dg-init
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cSi\]]] \
"" $DEFAULT_CFLAGS
+# C/C++ common tests.
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/*.\[cSi\]]] \
+ " -Wc++-compat " ""
+
# All done.
dg-finish
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 6b6dff0..fdef5af 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2894,3 +2894,24 @@ proc check_effective_target_correct_iso_cpp_string_wchar_protos { } {
#endif
}]
}
+
+# Return 1 if the language for the compiler under test is C.
+
+proc check_effective_target_c { } {
+ global tool
+ if [string match $tool "gcc"] {
+ return 1
+ }
+ return 0
+}
+
+# Return 1 if the language for the compiler under test is C++.
+
+proc check_effective_target_c++ { } {
+ global tool
+ if [string match $tool "g++"] {
+ return 1
+ }
+ return 0
+}
+