Skip to content

Clang doesn't support declspec attributes #6641

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 6269
Resolution FIXED
Resolved on Sep 23, 2013 17:12
Version trunk
OS Windows XP
Blocks llvm/llvm-bugzilla-archive#6815
Reporter LLVM Bugzilla Contributor
CC @asl,@tritao,@oscarfv,@rjmccall,@rnk

Extended Description

Hi,
I've tried this testcase with both Clang and (mingw32)gcc 4.4.3 :

__declspec(dllimport) void foo (int); void bar (void) { foo (0); }

The result was :

GCC :

.file	"testcase.c"
.text

.globl _bar
.def _bar; .scl 2; .type 32; .endef
_bar:
pushl %ebp
movl %esp, %ebp
subl $24, %esp
movl $0, (%esp)
movl __imp__foo, %eax
call *%eax
leave
ret

Clang :

.def	 _bar;	.scl	2;	.type	32;	.endef
.text
.globl	_bar
.align	16

_bar:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movl $0, (%esp)
call _foo
addl $8, %esp
popl %ebp
ret

.def	 _foo;	.scl	2;	.type	32;	.endef

It seems like clang doesn't seem to do name decorations. foo should have extension @​4 which is probably due to not handling the stdcall calling convention.

Please let me know how I can further help resolving this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions