entity = new_d_entity(global_type, id, ir_type_method, dbgi);
set_entity_ld_ident(entity, create_ld_ident(entity, declaration));
- if (declaration->storage_class == STORAGE_CLASS_STATIC
+ /* static inline => local
+ * extern inline => local
+ * inline without definition => local
+ * inline with definition => external_visible */
+
+ if (declaration->is_inline && declaration->storage_class == STORAGE_CLASS_NONE
+ && declaration->init.statement != NULL) {
+ set_entity_visibility(entity, visibility_external_visible);
+ }
+ else if (declaration->storage_class == STORAGE_CLASS_STATIC
|| declaration->is_inline) {
if (declaration->init.statement == NULL) {
/* this entity was declared, but is defined nowhere */
extern __inline__ unsigned int ntohl(unsigned int);
+__inline__ unsigned int ntohl2(unsigned int);
+static __inline__ unsigned int ntohl3(unsigned int);
+
+extern __inline__ unsigned int xntohl(unsigned int a) { return 1; }
+__inline__ unsigned int xntohl2(unsigned int a) { return 2; }
+static __inline__ unsigned int xntohl3(unsigned int a) { return 3; }
+
+// only xntohl2 should be globally visible
+// the others should not even exist in the object file
int main(void)
{