aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/mangle-ms.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/mangle-ms.cpp')
-rw-r--r--test/CodeGenCXX/mangle-ms.cpp39
1 files changed, 34 insertions, 5 deletions
diff --git a/test/CodeGenCXX/mangle-ms.cpp b/test/CodeGenCXX/mangle-ms.cpp
index f392c1701edd..0edb4b4339aa 100644
--- a/test/CodeGenCXX/mangle-ms.cpp
+++ b/test/CodeGenCXX/mangle-ms.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -fms-compatibility -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
// CHECK: @"\01?a@@3HA"
// CHECK: @"\01?b@N@@3HA"
@@ -7,16 +8,17 @@
// CHECK: @"\01?e@foo@@1JC"
// CHECK: @"\01?f@foo@@2DD"
// CHECK: @"\01?g@bar@@2HA"
-// CHECK: @"\01?h@@3QAHA"
+// CHECK: @"\01?h1@@3QAHA"
+// CHECK: @"\01?h2@@3QBHB"
// CHECK: @"\01?i@@3PAY0BE@HA"
// CHECK: @"\01?j@@3P6GHCE@ZA"
// CHECK: @"\01?k@@3PTfoo@@DA"
// CHECK: @"\01?l@@3P8foo@@AEHH@ZA"
// CHECK: @"\01?color1@@3PANA"
+// CHECK: @"\01?color2@@3QBNB"
-// FIXME: The following three tests currently fail, see PR13182.
+// FIXME: The following three tests currently fail, see http://llvm.org/PR13182
// Replace "CHECK-NOT" with "CHECK" when it is fixed.
-// CHECK-NOT: @"\01?color2@@3QBNB"
// CHECK-NOT: @"\01?color3@@3QAY02$$CBNA"
// CHECK-NOT: @"\01?color4@@3QAY02$$CBNA"
@@ -87,7 +89,8 @@ const volatile char foo::f = 'C';
int bar::g;
-extern int * const h = &a;
+extern int * const h1 = &a;
+extern const int * const h2 = &a;
int i[10][20];
@@ -107,6 +110,7 @@ bool __fastcall beta(long long a, wchar_t b) throw(signed char, unsigned char) {
}
// CHECK: @"\01?alpha@@YGXMN@Z"
+// X64: @"\01?alpha@@YAXMN@Z"
// Make sure tag-type mangling works.
void gamma(class foo, struct bar, union baz, enum quux) {}
@@ -128,6 +132,10 @@ void zeta(int (*)(int, int)) {}
void eta(int (^)(int, int)) {}
// CHECK: @"\01?eta@@YAXP_EAHHH@Z@Z"
+typedef int theta_arg(int,int);
+void theta(theta_arg^ block) {}
+// CHECK: @"\01?theta@@YAXP_EAHHH@Z@Z"
+
void operator_new_delete() {
char *ptr = new char;
// CHECK: @"\01??2@YAPAXI@Z"
@@ -147,7 +155,7 @@ void (redundant_parens)();
void redundant_parens_use() { redundant_parens(); }
// CHECK: @"\01?redundant_parens@@YAXXZ"
-// PR13182, PR13047
+// PR13047
typedef double RGB[3];
RGB color1;
extern const RGB color2 = {};
@@ -162,3 +170,24 @@ E fooE() { return E(); }
class X {};
// CHECK: "\01?fooX@@YA?AVX@@XZ"
X fooX() { return X(); }
+
+namespace PR13182 {
+ extern char s0[];
+ // CHECK: @"\01?s0@PR13182@@3PADA"
+ extern char s1[42];
+ // CHECK: @"\01?s1@PR13182@@3PADA"
+ extern const char s2[];
+ // CHECK: @"\01?s2@PR13182@@3QBDB"
+ extern const char s3[42];
+ // CHECK: @"\01?s3@PR13182@@3QBDB"
+ extern volatile char s4[];
+ // CHECK: @"\01?s4@PR13182@@3RCDC"
+ extern const volatile char s5[];
+ // CHECK: @"\01?s5@PR13182@@3SDDD"
+ extern const char* const* s6;
+ // CHECK: @"\01?s6@PR13182@@3PBQBDB"
+
+ char foo() {
+ return s0[0] + s1[0] + s2[0] + s3[0] + s4[0] + s5[0] + s6[0][0];
+ }
+}