Open llvmbot opened 10 years ago
Consider this testcase:
extern int name;
extern int name2;
int f(void) { return name + name2; }
clang output: 00000003: A1 00 00 00 00 mov eax,dword ptr [_imp__name] 00000008: 03 05 00 00 00 00 add eax,dword ptr [_imp__name2]
gcc output: 00000003: 8B 15 00 00 00 00 mov edx,dword ptr [_impname] 00000009: A1 00 00 00 00 mov eax,dword ptr [imp__name2]
Tested with clang version 3.6.0 (217266) Target: i686-pc-windows-gnu Thread model: posix
mentioned in issue llvm/llvm-project#7187
Extended Description
Consider this testcase:
pragma redefine_extname name _imp__name
extern int name;
extern int name2;
pragma redefine_extname name2 _imp__name2
int f(void) { return name + name2; }
clang output: 00000003: A1 00 00 00 00 mov eax,dword ptr [_imp__name] 00000008: 03 05 00 00 00 00 add eax,dword ptr [_imp__name2]
gcc output: 00000003: 8B 15 00 00 00 00 mov edx,dword ptr [_impname] 00000009: A1 00 00 00 00 mov eax,dword ptr [imp__name2]
Tested with clang version 3.6.0 (217266) Target: i686-pc-windows-gnu Thread model: posix