diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2001-03-06 10:04:54 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2001-03-06 10:04:54 +0000 |
commit | 69f8cbfaa92e236bf8b7841403d23e07fb113494 (patch) | |
tree | c7b3a28a926f9e64d20cdaac03ad76793baa4910 /gcc/objc | |
parent | 1f50aafb85ecf587bc0e03864e9c4f67e762b279 (diff) | |
download | gcc-69f8cbfaa92e236bf8b7841403d23e07fb113494.zip gcc-69f8cbfaa92e236bf8b7841403d23e07fb113494.tar.gz gcc-69f8cbfaa92e236bf8b7841403d23e07fb113494.tar.bz2 |
objc-act.c (objc_add_static_instance): Set DECL_INITIAL and DECL_DEFER_OUTPUT on the decl we create...
* objc/objc-act.c (objc_add_static_instance): Set DECL_INITIAL
and DECL_DEFER_OUTPUT on the decl we create, before calling
rest_of_decl_compilation.
testsuite:
* objc/execute/string1.m, objc/execute/string2.m: Compare the
result of -cString against what we expect it to be; don't just
print it out for no one to read.
* objc/execute/string3.m, objc/execute/string4.m: New tests.
Based on testcases provided by Nicola Pero.
From-SVN: r40261
Diffstat (limited to 'gcc/objc')
-rw-r--r-- | gcc/objc/objc-act.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index f5f27ad..99cb297 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -1474,13 +1474,14 @@ objc_add_static_instance (constructor, class_decl) DECL_COMMON (decl) = 1; TREE_STATIC (decl) = 1; DECL_ARTIFICIAL (decl) = 1; + DECL_INITIAL (decl) = constructor; + + /* We may be writing something else just now. + Postpone till end of input. */ + DECL_DEFER_OUTPUT (decl) = 1; pushdecl_top_level (decl); rest_of_decl_compilation (decl, 0, 1, 0); - /* Do this here so it gets output later instead of possibly - inside something else we are writing. */ - DECL_INITIAL (decl) = constructor; - /* Add the DECL to the head of this CLASS' list. */ TREE_PURPOSE (*chain) = tree_cons (NULL_TREE, decl, TREE_PURPOSE (*chain)); |