aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@gmail.com>2007-01-20 22:51:07 -0800
committerAndrew Pinski <pinskia@gcc.gnu.org>2007-01-20 22:51:07 -0800
commitd2f9f9a62d25b0d4f358952430664c76a86967e9 (patch)
tree082440aebef934d380dad11831fe7fc3c40506e4 /gcc/testsuite/objc.dg
parent78681dbdee7e724104d79eca9fc0e2eaeaf8eae2 (diff)
downloadgcc-d2f9f9a62d25b0d4f358952430664c76a86967e9.zip
gcc-d2f9f9a62d25b0d4f358952430664c76a86967e9.tar.gz
gcc-d2f9f9a62d25b0d4f358952430664c76a86967e9.tar.bz2
re PR objc/30479 (Precompiled headers don't seem to work with GNU ObjC)
2007-01-20 Andrew Pinski <pinskia@gmail.com> PR objc/30479 * objc-act.c (hash_interface): Use IDENTIFIER_HASH_VALUE instead of htab_hash_pointer. (lookup_interface): Likewise. (add_class): Likewise. 2007-01-20 Andrew Pinski <pinskia@gmail.com> PR objc/30479 * objc.dg/pch: New directory. * objc.dg/pch/pch.exp: New file. * objc.dg/pch/interface-1.m: New test. * objc.dg/pch/interface-1.hs: New include file. * lib/objc.exp (objc_target_compile): Add "-x objective-c-header" in front of the sources if this is a precompiled header being compiled. From-SVN: r121024
Diffstat (limited to 'gcc/testsuite/objc.dg')
-rw-r--r--gcc/testsuite/objc.dg/pch/interface-1.hs4
-rw-r--r--gcc/testsuite/objc.dg/pch/interface-1.m14
-rw-r--r--gcc/testsuite/objc.dg/pch/pch.exp43
3 files changed, 61 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/pch/interface-1.hs b/gcc/testsuite/objc.dg/pch/interface-1.hs
new file mode 100644
index 0000000..fe5255a
--- /dev/null
+++ b/gcc/testsuite/objc.dg/pch/interface-1.hs
@@ -0,0 +1,4 @@
+@interface TestClass
++ (int) test;
+@end
+
diff --git a/gcc/testsuite/objc.dg/pch/interface-1.m b/gcc/testsuite/objc.dg/pch/interface-1.m
new file mode 100644
index 0000000..9bc7ef3
--- /dev/null
+++ b/gcc/testsuite/objc.dg/pch/interface-1.m
@@ -0,0 +1,14 @@
+#include "interface-1.h"
+
+@implementation TestClass
++ (int) test
+{
+ return 0;
+}
+@end
+
+int main (void)
+{
+ return [TestClass test];
+}
+
diff --git a/gcc/testsuite/objc.dg/pch/pch.exp b/gcc/testsuite/objc.dg/pch/pch.exp
new file mode 100644
index 0000000..ad5697b
--- /dev/null
+++ b/gcc/testsuite/objc.dg/pch/pch.exp
@@ -0,0 +1,43 @@
+# Copyright (C) 1997, 2002, 2003 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 2 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 this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# GCC testsuite for precompiled header interaction,
+# that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib objc-dg.exp
+load_lib dg-pch.exp
+
+# Initialize `dg'.
+dg-init
+
+set old_dg_do_what_default "${dg-do-what-default}"
+
+# Main loop.
+foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.m]] {
+ 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.
+ dg-pch $subdir $test [concat [list {-O0 -g}] $torture_without_loops] ".h"
+}
+
+set dg-do-what-default "$old_dg_do_what_default"
+
+# All done.
+dg-finish