blob: 6787b6bd34f26a2015dd8e8dc86ca2c0b75661b3 [file] [log] [blame]
Charles Davis65161d12010-06-16 05:33:16 +00001// RUN: %clang_cc1 -fms-extensions -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-apple-darwin10 | FileCheck %s
Charles Davise60cea82010-06-11 03:07:32 +00002
Charles Davisb021f8b2010-06-14 05:29:01 +00003// CHECK: @"\01?a@@3HA"
4// CHECK: @"\01?b@N@@3HA"
Charles Davis570d2762010-06-12 08:11:16 +00005// CHECK: @c
Charles Davisb021f8b2010-06-14 05:29:01 +00006// CHECK: @"\01?d@foo@@0FB"
7// CHECK: @"\01?e@foo@@1JC"
8// CHECK: @"\01?f@foo@@2DD"
Charles Davis570d2762010-06-12 08:11:16 +00009
10int a;
Charles Davise60cea82010-06-11 03:07:32 +000011
12namespace N { int b; }
Charles Davis570d2762010-06-12 08:11:16 +000013
14static int c;
15int _c(void) {return c;}
Charles Davis65161d12010-06-16 05:33:16 +000016// CHECK: @"\01?_c@@YAHXZ"
Charles Davis570d2762010-06-12 08:11:16 +000017
Charles Davisb021f8b2010-06-14 05:29:01 +000018class foo {
19 static const short d;
20protected:
21 static volatile long e;
22public:
23 static const volatile char f;
Charles Davis21e2a7e2010-06-17 06:47:31 +000024 int operator+(int a);
Charles Davisb021f8b2010-06-14 05:29:01 +000025};
26
Charles Davis21e2a7e2010-06-17 06:47:31 +000027int foo::operator+(int a) {return a;}
28// CHECK: @"\01??Hfoo@@QAAHH@Z"
29
Charles Davisb021f8b2010-06-14 05:29:01 +000030const short foo::d = 0;
31volatile long foo::e;
32const volatile char foo::f = 'C';
33
Charles Davis65161d12010-06-16 05:33:16 +000034// Static functions are mangled, too.
35// Also make sure calling conventions, arglists, and throw specs work.
36static void __stdcall alpha(float a, double b) throw() {}
37bool __fastcall beta(long long a, wchar_t b) throw(signed char, unsigned char) {
38// CHECK: @"\01?beta@@YI_N_J_W@CE@"
39 alpha(0.f, 0.0);
40 return false;
41}
42
43// CHECK: @"\01?alpha@@YGXMN@@"
44