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
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'.
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;
+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.
{
a();
}
-
-extern int c __attribute__((weak_import)); /* { dg-warning "ignored" } */
--- /dev/null
+/* 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;
+}