===================================================================
@@ -362,6 +362,12 @@ proc obj-c++_target_compile { source dest type opt
}
}
+ if { $type == "precompiled_header" } {
+ # If we generating a precompiled header, we have say this is an
+ # objective-C header.
+ set source [concat "-x objective-c++-header" $source]
+ }
+
lappend options "additional_flags=[libio_include_flags]"
lappend options "compiler=$OBJCXX_UNDER_TEST";
lappend options "timeout=[timeout_value]"
===================================================================
@@ -1,3 +1,12 @@
+2011-02-20 Iain Sandoe <iains@gcc.gnu.org>
+
+ PR objc++/47711
+ * lib/obj-c++.exp: Updated to support pch test.
+ * obj-c++.dg/pch: New.
+ * obj-c++.dg/pch/pch.exp: New.
+ * obj-c++.dg/pch/interface-1.mm: New.
+ * obj-c++.dg/pch/interface-1.hs: New.
+
2011-02-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/44118
===================================================================
@@ -0,0 +1,64 @@
+# Copyright (C) 1997, 2002, 2003, 2007, 2008, 2010
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite for precompiled header interaction,
+# that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib obj-c++-dg.exp
+load_lib dg-pch.exp
+load_lib torture-options.exp
+
+# Initialize `dg'.
+dg-init
+
+torture-init
+
+set-torture-options $DG_TORTURE_OPTIONS
+
+set old_dg_do_what_default "${dg-do-what-default}"
+
+global torture_without_loops
+
+# We don't try to use the loop-optimizing options, since they are highly
+# unlikely to make any difference to PCH. However, we do want to
+# add -O0 -g, since users who want PCH usually want debugging and quick
+# compiles.
+
+set mytorture [concat [list {-O0 -g}] $torture_without_loops]
+
+set tests [lsort [glob -nocomplain $srcdir/$subdir/*.mm]]
+# Main loop.
+foreach test $tests {
+
+ dg-flags-pch $subdir $test "-fgnu-runtime" $mytorture ".h"
+}
+
+if [istarget "*-*-darwin*" ] {
+ foreach test $tests {
+ global torture_without_loops
+
+ # as above
+ dg-flags-pch $subdir $test "-fnext-runtime" $mytorture ".h"
+ }
+}
+
+set dg-do-what-default "$old_dg_do_what_default"
+
+# All done.
+torture-finish
+dg-finish
===================================================================
@@ -0,0 +1,14 @@
+#include "interface-1.h"
+
+@implementation TestClass
++ (int) test
+{
+ return 0;
+}
+@end
+
+int main (void)
+{
+ return [TestClass test];
+}
+
===================================================================
@@ -0,0 +1,4 @@
+@interface TestClass
++ (int) test;
+@end
+
===================================================================
@@ -1,3 +1,8 @@
+2011-02-20 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR objc++/47711
+ * config-lang.in (gtfiles): Updated list.
+
2011-02-17 Iain Sandoe <iains@gcc.gnu.org>
* Make-lang.in (START_HDRS): New.
===================================================================
@@ -37,4 +37,5 @@ build_by_default="no"
lang_requires="objc c++"
subdir_requires="objc cp"
-gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-runtime-shared-support.c \$(srcdir)/objc/objc-gnu-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-02.c \$(srcdir)/cp/call.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/method.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-objcp-common.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/rtti.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-lex.c \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c "
+gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-runtime-shared-support.c \$(srcdir)/objc/objc-gnu-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-02.c \$(srcdir)/cp/call.c \$(srcdir)/cp/class.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/method.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-objcp-common.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/rtti.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-lex.c \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c "
+