1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc void f1(const char* a, const char* b) {} 4*f4a2713aSLionel Sambuc // CHECK: "\01?f1@@YAXPBD0@Z" 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel Sambuc void f2(const char* a, char* b) {} 7*f4a2713aSLionel Sambuc // CHECK: "\01?f2@@YAXPBDPAD@Z" 8*f4a2713aSLionel Sambuc 9*f4a2713aSLionel Sambuc void f3(int a, const char* b, const char* c) {} 10*f4a2713aSLionel Sambuc // CHECK: "\01?f3@@YAXHPBD0@Z" 11*f4a2713aSLionel Sambuc 12*f4a2713aSLionel Sambuc const char *f4(const char* a, const char* b) { return 0; } 13*f4a2713aSLionel Sambuc // CHECK: "\01?f4@@YAPBDPBD0@Z" 14*f4a2713aSLionel Sambuc 15*f4a2713aSLionel Sambuc void f5(char const* a, unsigned int b, char c, void const* d, char const* e, unsigned int f) {} 16*f4a2713aSLionel Sambuc // CHECK: "\01?f5@@YAXPBDIDPBX0I@Z" 17*f4a2713aSLionel Sambuc 18*f4a2713aSLionel Sambuc void f6(bool a, bool b) {} 19*f4a2713aSLionel Sambuc // CHECK: "\01?f6@@YAX_N0@Z" 20*f4a2713aSLionel Sambuc 21*f4a2713aSLionel Sambuc void f7(int a, int* b, int c, int* d, bool e, bool f, bool* g) {} 22*f4a2713aSLionel Sambuc // CHECK: "\01?f7@@YAXHPAHH0_N1PA_N@Z" 23*f4a2713aSLionel Sambuc 24*f4a2713aSLionel Sambuc // FIXME: tests for more than 10 types? 25*f4a2713aSLionel Sambuc 26*f4a2713aSLionel Sambuc struct S { 27*f4a2713aSLionel Sambuc void mbb(bool a, bool b) {} 28*f4a2713aSLionel Sambuc }; 29*f4a2713aSLionel Sambuc 30*f4a2713aSLionel Sambuc void g1(struct S a) {} 31*f4a2713aSLionel Sambuc // CHECK: "\01?g1@@YAXUS@@@Z" 32*f4a2713aSLionel Sambuc 33*f4a2713aSLionel Sambuc void g2(struct S a, struct S b) {} 34*f4a2713aSLionel Sambuc // CHECK: "\01?g2@@YAXUS@@0@Z" 35*f4a2713aSLionel Sambuc 36*f4a2713aSLionel Sambuc void g3(struct S a, struct S b, struct S* c, struct S* d) {} 37*f4a2713aSLionel Sambuc // CHECK: "\01?g3@@YAXUS@@0PAU1@1@Z" 38*f4a2713aSLionel Sambuc 39*f4a2713aSLionel Sambuc void g4(const char* a, struct S* b, const char* c, struct S* d) { 40*f4a2713aSLionel Sambuc // CHECK: "\01?g4@@YAXPBDPAUS@@01@Z" 41*f4a2713aSLionel Sambuc b->mbb(false, false); 42*f4a2713aSLionel Sambuc // CHECK: "\01?mbb@S@@QAEX_N0@Z" 43*f4a2713aSLionel Sambuc } 44*f4a2713aSLionel Sambuc 45*f4a2713aSLionel Sambuc // Make sure that different aliases of built-in types end up mangled as the 46*f4a2713aSLionel Sambuc // built-ins. 47*f4a2713aSLionel Sambuc typedef unsigned int uintptr_t; 48*f4a2713aSLionel Sambuc typedef unsigned int size_t; 49*f4a2713aSLionel Sambuc void *h(size_t a, uintptr_t b) { return 0; } 50*f4a2713aSLionel Sambuc // CHECK: "\01?h@@YAPAXII@Z" 51*f4a2713aSLionel Sambuc 52*f4a2713aSLionel Sambuc // Function pointers might be mangled in a complex way. 53*f4a2713aSLionel Sambuc typedef void (*VoidFunc)(); 54*f4a2713aSLionel Sambuc typedef int* (*PInt3Func)(int* a, int* b); 55*f4a2713aSLionel Sambuc 56*f4a2713aSLionel Sambuc void h1(const char* a, const char* b, VoidFunc c, VoidFunc d) {} 57*f4a2713aSLionel Sambuc // CHECK: "\01?h1@@YAXPBD0P6AXXZ1@Z" 58*f4a2713aSLionel Sambuc 59*f4a2713aSLionel Sambuc void h2(void (*f_ptr)(void *), void *arg) {} 60*f4a2713aSLionel Sambuc // CHECK: "\01?h2@@YAXP6AXPAX@Z0@Z" 61*f4a2713aSLionel Sambuc 62*f4a2713aSLionel Sambuc PInt3Func h3(PInt3Func x, PInt3Func y, int* z) { return 0; } 63*f4a2713aSLionel Sambuc // CHECK: "\01?h3@@YAP6APAHPAH0@ZP6APAH00@Z10@Z" 64*f4a2713aSLionel Sambuc 65*f4a2713aSLionel Sambuc namespace foo { 66*f4a2713aSLionel Sambuc void foo() { } 67*f4a2713aSLionel Sambuc // CHECK: "\01?foo@0@YAXXZ" 68*f4a2713aSLionel Sambuc } 69