2014-01-15 03:35:09 +08:00
|
|
|
// RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
|
2012-06-21 10:52:27 +08:00
|
|
|
|
|
|
|
void f1(const char* a, const char* b) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?f1@@YAXPBD0@Z"
|
2012-06-21 10:52:27 +08:00
|
|
|
|
|
|
|
void f2(const char* a, char* b) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?f2@@YAXPBDPAD@Z"
|
2012-06-21 10:52:27 +08:00
|
|
|
|
|
|
|
void f3(int a, const char* b, const char* c) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?f3@@YAXHPBD0@Z"
|
2012-06-21 10:52:27 +08:00
|
|
|
|
2012-06-27 06:29:50 +08:00
|
|
|
const char *f4(const char* a, const char* b) { return 0; }
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?f4@@YAPBDPBD0@Z"
|
2012-06-21 10:52:27 +08:00
|
|
|
|
2012-06-23 08:54:17 +08:00
|
|
|
void f5(char const* a, unsigned int b, char c, void const* d, char const* e, unsigned int f) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?f5@@YAXPBDIDPBX0I@Z"
|
2012-06-23 08:54:17 +08:00
|
|
|
|
|
|
|
void f6(bool a, bool b) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?f6@@YAX_N0@Z"
|
2012-06-23 08:54:17 +08:00
|
|
|
|
|
|
|
void f7(int a, int* b, int c, int* d, bool e, bool f, bool* g) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?f7@@YAXHPAHH0_N1PA_N@Z"
|
2012-06-23 08:54:17 +08:00
|
|
|
|
2012-06-21 10:52:27 +08:00
|
|
|
// FIXME: tests for more than 10 types?
|
|
|
|
|
2012-06-23 08:54:17 +08:00
|
|
|
struct S {
|
|
|
|
void mbb(bool a, bool b) {}
|
|
|
|
};
|
2012-06-21 10:52:27 +08:00
|
|
|
|
2012-06-23 08:54:17 +08:00
|
|
|
void g1(struct S a) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?g1@@YAXUS@@@Z"
|
2012-06-21 10:52:27 +08:00
|
|
|
|
2012-06-23 08:54:17 +08:00
|
|
|
void g2(struct S a, struct S b) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?g2@@YAXUS@@0@Z"
|
2012-06-23 08:54:17 +08:00
|
|
|
|
|
|
|
void g3(struct S a, struct S b, struct S* c, struct S* d) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?g3@@YAXUS@@0PAU1@1@Z"
|
2012-06-21 10:52:27 +08:00
|
|
|
|
2012-06-23 08:54:17 +08:00
|
|
|
void g4(const char* a, struct S* b, const char* c, struct S* d) {
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?g4@@YAXPBDPAUS@@01@Z"
|
2012-06-23 08:54:17 +08:00
|
|
|
b->mbb(false, false);
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?mbb@S@@QAEX_N0@Z"
|
2012-06-23 08:54:17 +08:00
|
|
|
}
|
2012-06-21 10:52:27 +08:00
|
|
|
|
|
|
|
// Make sure that different aliases of built-in types end up mangled as the
|
|
|
|
// built-ins.
|
|
|
|
typedef unsigned int uintptr_t;
|
|
|
|
typedef unsigned int size_t;
|
2012-06-27 06:29:50 +08:00
|
|
|
void *h(size_t a, uintptr_t b) { return 0; }
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?h@@YAPAXII@Z"
|
2012-06-23 08:54:17 +08:00
|
|
|
|
|
|
|
// Function pointers might be mangled in a complex way.
|
|
|
|
typedef void (*VoidFunc)();
|
|
|
|
typedef int* (*PInt3Func)(int* a, int* b);
|
|
|
|
|
|
|
|
void h1(const char* a, const char* b, VoidFunc c, VoidFunc d) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?h1@@YAXPBD0P6AXXZ1@Z"
|
2012-06-23 08:54:17 +08:00
|
|
|
|
|
|
|
void h2(void (*f_ptr)(void *), void *arg) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?h2@@YAXP6AXPAX@Z0@Z"
|
2012-06-23 08:54:17 +08:00
|
|
|
|
|
|
|
PInt3Func h3(PInt3Func x, PInt3Func y, int* z) { return 0; }
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?h3@@YAP6APAHPAH0@ZP6APAH00@Z10@Z"
|
2013-07-13 08:43:39 +08:00
|
|
|
|
|
|
|
namespace foo {
|
|
|
|
void foo() { }
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: "?foo@0@YAXXZ"
|
2013-07-13 08:43:39 +08:00
|
|
|
}
|
2019-10-11 20:27:51 +08:00
|
|
|
|
|
|
|
class T01;
|
|
|
|
class T02;
|
|
|
|
class T03;
|
|
|
|
class T04;
|
|
|
|
class T05;
|
|
|
|
class T06;
|
|
|
|
class T07;
|
|
|
|
class T08;
|
|
|
|
class T09;
|
|
|
|
class T10;
|
|
|
|
class T11;
|
|
|
|
template <typename T>
|
|
|
|
class H;
|
|
|
|
|
|
|
|
void ManyParams(T01 &, T02 &, T03 &, T04 &, T05 &, T06 &, T07 &, T08 &, T09 &, T10 &, H<T11> &, H<T11> &) {}
|
|
|
|
// CHECK: "?ManyParams@@YAXAAVT01@@AAVT02@@AAVT03@@AAVT04@@AAVT05@@AAVT06@@AAVT07@@AAVT08@@AAVT09@@AAVT10@@AAV?$H@VT11@@@@AAV?$H@VT11@@@@@Z"
|