2009-11-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Pass the list
+ of attributes when building the corresponding variable of a constant.
+ * gcc-interface/utils.c (create_var_decl_1): Do not process attributes
+ for constants.
+
+2009-11-23 Eric Botcazou <ebotcazou@adacore.com>
Laurent GUERBY <laurent@guerby.net>
PR ada/42153
tree gnu_corr_var
= create_true_var_decl (gnu_entity_name, gnu_ext_name, gnu_type,
gnu_expr, true, Is_Public (gnat_entity),
- !definition, static_p, NULL,
+ !definition, static_p, attr_list,
gnat_entity);
SET_DECL_CONST_CORRESPONDING_VAR (gnu_decl, gnu_corr_var);
!= null_pointer_node)
DECL_IGNORED_P (var_decl) = 1;
- if (asm_name && VAR_OR_FUNCTION_DECL_P (var_decl))
- SET_DECL_ASSEMBLER_NAME (var_decl, asm_name);
-
- process_attributes (var_decl, attr_list);
+ if (TREE_CODE (var_decl) == VAR_DECL)
+ {
+ if (asm_name)
+ SET_DECL_ASSEMBLER_NAME (var_decl, asm_name);
+ process_attributes (var_decl, attr_list);
+ }
/* Add this decl to the current binding level. */
gnat_pushdecl (var_decl, gnat_node);
+2009-11-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/weak1.ads: New test.
+
2009-11-23 Steve Ellcey <sje@cup.hp.com>
* gcc.dg/debug/dwarf2/inline2.c: Modify scan.
--- /dev/null
+package Weak1 is
+
+ Myconst : constant Integer := 1234;
+ pragma Export (C, Myconst, "myconst");
+ pragma Weak_External (Myconst);
+
+end Weak1;