Charles Davis | 65161d1 | 2010-06-16 05:33:16 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fms-extensions -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-apple-darwin10 | FileCheck %s |
Charles Davis | e60cea8 | 2010-06-11 03:07:32 +0000 | [diff] [blame] | 2 | |
Charles Davis | b021f8b | 2010-06-14 05:29:01 +0000 | [diff] [blame] | 3 | // CHECK: @"\01?a@@3HA" |
| 4 | // CHECK: @"\01?b@N@@3HA" |
Charles Davis | 570d276 | 2010-06-12 08:11:16 +0000 | [diff] [blame] | 5 | // CHECK: @c |
Charles Davis | b021f8b | 2010-06-14 05:29:01 +0000 | [diff] [blame] | 6 | // CHECK: @"\01?d@foo@@0FB" |
| 7 | // CHECK: @"\01?e@foo@@1JC" |
| 8 | // CHECK: @"\01?f@foo@@2DD" |
Charles Davis | 570d276 | 2010-06-12 08:11:16 +0000 | [diff] [blame] | 9 | |
| 10 | int a; |
Charles Davis | e60cea8 | 2010-06-11 03:07:32 +0000 | [diff] [blame] | 11 | |
| 12 | namespace N { int b; } |
Charles Davis | 570d276 | 2010-06-12 08:11:16 +0000 | [diff] [blame] | 13 | |
| 14 | static int c; |
| 15 | int _c(void) {return c;} |
Charles Davis | 65161d1 | 2010-06-16 05:33:16 +0000 | [diff] [blame] | 16 | // CHECK: @"\01?_c@@YAHXZ" |
Charles Davis | 570d276 | 2010-06-12 08:11:16 +0000 | [diff] [blame] | 17 | |
Charles Davis | b021f8b | 2010-06-14 05:29:01 +0000 | [diff] [blame] | 18 | class foo { |
| 19 | static const short d; |
| 20 | protected: |
| 21 | static volatile long e; |
| 22 | public: |
| 23 | static const volatile char f; |
Charles Davis | 21e2a7e | 2010-06-17 06:47:31 +0000 | [diff] [blame^] | 24 | int operator+(int a); |
Charles Davis | b021f8b | 2010-06-14 05:29:01 +0000 | [diff] [blame] | 25 | }; |
| 26 | |
Charles Davis | 21e2a7e | 2010-06-17 06:47:31 +0000 | [diff] [blame^] | 27 | int foo::operator+(int a) {return a;} |
| 28 | // CHECK: @"\01??Hfoo@@QAAHH@Z" |
| 29 | |
Charles Davis | b021f8b | 2010-06-14 05:29:01 +0000 | [diff] [blame] | 30 | const short foo::d = 0; |
| 31 | volatile long foo::e; |
| 32 | const volatile char foo::f = 'C'; |
| 33 | |
Charles Davis | 65161d1 | 2010-06-16 05:33:16 +0000 | [diff] [blame] | 34 | // Static functions are mangled, too. |
| 35 | // Also make sure calling conventions, arglists, and throw specs work. |
| 36 | static void __stdcall alpha(float a, double b) throw() {} |
| 37 | bool __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 | |