2010-06-16 13:33:16 +08:00
|
|
|
// RUN: %clang_cc1 -fms-extensions -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-apple-darwin10 | FileCheck %s
|
2010-06-11 11:07:32 +08:00
|
|
|
|
2010-06-14 13:29:01 +08:00
|
|
|
// CHECK: @"\01?a@@3HA"
|
|
|
|
// CHECK: @"\01?b@N@@3HA"
|
2010-06-12 16:11:16 +08:00
|
|
|
// CHECK: @c
|
2010-06-14 13:29:01 +08:00
|
|
|
// CHECK: @"\01?d@foo@@0FB"
|
|
|
|
// CHECK: @"\01?e@foo@@1JC"
|
|
|
|
// CHECK: @"\01?f@foo@@2DD"
|
2010-06-18 15:51:00 +08:00
|
|
|
// CHECK: @"\01?g@bar@@2HA"
|
2010-06-26 11:50:05 +08:00
|
|
|
// CHECK: @"\01?h@@3QAHA"
|
2010-06-30 16:09:57 +08:00
|
|
|
// CHECK: @"\01?i@@3PAY0BD@HA"
|
2010-07-03 13:53:41 +08:00
|
|
|
// CHECK: @"\01?j@@3P6GHCE@ZA"
|
2010-06-12 16:11:16 +08:00
|
|
|
|
|
|
|
int a;
|
2010-06-11 11:07:32 +08:00
|
|
|
|
|
|
|
namespace N { int b; }
|
2010-06-12 16:11:16 +08:00
|
|
|
|
|
|
|
static int c;
|
|
|
|
int _c(void) {return c;}
|
2010-06-16 13:33:16 +08:00
|
|
|
// CHECK: @"\01?_c@@YAHXZ"
|
2010-06-12 16:11:16 +08:00
|
|
|
|
2010-06-14 13:29:01 +08:00
|
|
|
class foo {
|
|
|
|
static const short d;
|
|
|
|
protected:
|
|
|
|
static volatile long e;
|
|
|
|
public:
|
|
|
|
static const volatile char f;
|
2010-06-17 14:47:31 +08:00
|
|
|
int operator+(int a);
|
2010-06-14 13:29:01 +08:00
|
|
|
};
|
|
|
|
|
2010-06-18 15:51:00 +08:00
|
|
|
struct bar {
|
|
|
|
static int g;
|
|
|
|
};
|
|
|
|
|
|
|
|
union baz {
|
|
|
|
int a;
|
|
|
|
char b;
|
|
|
|
double c;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum quux {
|
|
|
|
qone,
|
|
|
|
qtwo,
|
|
|
|
qthree
|
|
|
|
};
|
|
|
|
|
2010-06-30 16:09:57 +08:00
|
|
|
// NOTE: The calling convention is supposed to be __thiscall by default,
|
|
|
|
// but that needs to be fixed in Sema/AST.
|
2010-06-17 14:47:31 +08:00
|
|
|
int foo::operator+(int a) {return a;}
|
|
|
|
// CHECK: @"\01??Hfoo@@QAAHH@Z"
|
|
|
|
|
2010-06-14 13:29:01 +08:00
|
|
|
const short foo::d = 0;
|
|
|
|
volatile long foo::e;
|
|
|
|
const volatile char foo::f = 'C';
|
|
|
|
|
2010-06-18 15:51:00 +08:00
|
|
|
int bar::g;
|
|
|
|
|
2010-06-26 11:50:05 +08:00
|
|
|
extern int * const h = &a;
|
|
|
|
|
2010-06-30 16:09:57 +08:00
|
|
|
int i[10][20];
|
|
|
|
|
2010-07-03 13:53:41 +08:00
|
|
|
int (__stdcall *j)(signed char, unsigned char);
|
|
|
|
|
2010-06-16 13:33:16 +08:00
|
|
|
// Static functions are mangled, too.
|
|
|
|
// Also make sure calling conventions, arglists, and throw specs work.
|
|
|
|
static void __stdcall alpha(float a, double b) throw() {}
|
|
|
|
bool __fastcall beta(long long a, wchar_t b) throw(signed char, unsigned char) {
|
2010-06-26 11:50:05 +08:00
|
|
|
// CHECK: @"\01?beta@@YI_N_J_W@Z"
|
2010-06-16 13:33:16 +08:00
|
|
|
alpha(0.f, 0.0);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2010-06-26 11:50:05 +08:00
|
|
|
// CHECK: @"\01?alpha@@YGXMN@Z"
|
2010-06-16 13:33:16 +08:00
|
|
|
|
2010-06-18 15:51:00 +08:00
|
|
|
// Make sure tag-type mangling works.
|
|
|
|
void gamma(class foo, struct bar, union baz, enum quux) {}
|
|
|
|
// CHECK: @"\01?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z"
|
|
|
|
|
2010-06-26 11:50:05 +08:00
|
|
|
// Make sure pointer/reference-type mangling works.
|
|
|
|
void delta(int * const a, const long &) {}
|
|
|
|
// CHECK: @"\01?delta@@YAXQAHABJ@Z"
|
2010-06-30 16:09:57 +08:00
|
|
|
|
|
|
|
// Array mangling. (It should be mangled as a const pointer, but that needs
|
|
|
|
// to be fixed in Sema.)
|
|
|
|
void epsilon(int a[][10][20]) {}
|
2010-07-03 10:41:45 +08:00
|
|
|
// CHECK: @"\01?epsilon@@YAXQAY19BD@H@Z"
|