http://llvm.org/bugs/show_bug.cgi?id=14410
Bug #: 14410
Summary: [-cxx-abi microsoft] Wrong mangling of __stdcall
functions?
Product: clang
Version: trunk
Platform: PC
OS/Version: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
=== stdcall.cpp ===
extern int cnt;
void __stdcall foo();
#ifdef CONFIG_1
void __stdcall foo() {
cnt = 42;
}
#else
int cnt = 10;
int main() {
void (__stdcall *ptr)() = foo;
(*ptr)();
return (cnt == 42) ? 0 : 1;
}
#endif
===================
$ cl -c -Fostdcall_1_1.obj -DCONFIG_1 stdcall.cpp
$ clang -Xclang -cxx-abi -Xclang microsoft -c -ostdcall_1_2.o stdcall.cpp
$ link stdcall_1_1.obj stdcall_1_2.o
stdcall_1_2.o : error LNK2019: unresolved external symbol "?foo@@YGXXZ@0"
(?foo@@YGXXZ@0) referenced in function _main
$ cl -c -Fostdcall_2_1.o stdcall.cpp
$ clang -Xclang -cxx-abi -Xclang microsoft -c -ostdcall_2_2.obj -DCONFIG_1
stdcall.cpp
$ link stdcall_2_1.o stdcall_2_2.obj
stdcall_2_1.o : error LNK2019: unresolved external symbol "void __stdcall
foo(void)" (?foo@@YGXXZ) referenced in function _main
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs