mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-25 16:50:49 +08:00
darwin.c (darwin_handle_weak_import_attribute): Permit VAR_DECLs to have weak_import attribute.
2005-01-03 Geoffrey Keating <geoffk@apple.com> * config/darwin.c (darwin_handle_weak_import_attribute): Permit VAR_DECLs to have weak_import attribute. Index: testsuite/ChangeLog 2005-01-03 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-weakimport-1.c: Remove check for variables producing warning. * gcc.dg/darwin-weakimport-2.c: New. From-SVN: r92871
This commit is contained in:
parent
a035080cbc
commit
d7001ae593
@ -1,5 +1,8 @@
|
||||
2005-01-03 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* config/darwin.c (darwin_handle_weak_import_attribute): Permit
|
||||
VAR_DECLs to have weak_import attribute.
|
||||
|
||||
* config/rs6000/darwin-fallback.c: Use 'ucontext_t' rather than
|
||||
'struct ucontext'.
|
||||
|
||||
|
@ -1228,7 +1228,7 @@ darwin_handle_weak_import_attribute (tree *node, tree name,
|
||||
int ARG_UNUSED (flags),
|
||||
bool * no_add_attrs)
|
||||
{
|
||||
if (TREE_CODE (*node) != FUNCTION_DECL)
|
||||
if (TREE_CODE (*node) != FUNCTION_DECL && TREE_CODE (*node) != VAR_DECL)
|
||||
{
|
||||
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
|
||||
*no_add_attrs = true;
|
||||
|
@ -1,3 +1,9 @@
|
||||
2005-01-03 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* gcc.dg/darwin-weakimport-1.c: Remove check for variables
|
||||
producing warning.
|
||||
* gcc.dg/darwin-weakimport-2.c: New.
|
||||
|
||||
2005-01-03 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* g++.old-deja/g++.ext/attrib5.C: Move the alias after the referent.
|
||||
|
@ -12,5 +12,3 @@ void b(void)
|
||||
{
|
||||
a();
|
||||
}
|
||||
|
||||
extern int c __attribute__((weak_import)); /* { dg-warning "ignored" } */
|
||||
|
14
gcc/testsuite/gcc.dg/darwin-weakimport-2.c
Normal file
14
gcc/testsuite/gcc.dg/darwin-weakimport-2.c
Normal file
@ -0,0 +1,14 @@
|
||||
/* APPLE LOCAL file put in 4.1 */
|
||||
/* { dg-do compile { target *-*-darwin* } } */
|
||||
/* { dg-require-weak "" } */
|
||||
|
||||
/* { dg-final { scan-assembler "weak_reference _foo" } } */
|
||||
|
||||
extern int foo __attribute__((weak_import));
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (&foo)
|
||||
return foo;
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user