Richard Smith | 06e767d | 2012-06-21 02:52:27 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s |
| 2 | |
| 3 | void f1(const char* a, const char* b) {} |
| 4 | // CHECK: "\01?f1@@YAXPBD0@Z" |
| 5 | |
| 6 | void f2(const char* a, char* b) {} |
| 7 | // CHECK: "\01?f2@@YAXPBDPAD@Z" |
| 8 | |
| 9 | void f3(int a, const char* b, const char* c) {} |
| 10 | // CHECK: "\01?f3@@YAXHPBD0@Z" |
| 11 | |
| 12 | const char *f4(const char* a, const char* b) {} |
| 13 | // CHECK: "\01?f4@@YAPBDPBD0@Z" |
| 14 | |
| 15 | // FIXME: tests for more than 10 types? |
| 16 | |
| 17 | struct S {}; |
| 18 | |
| 19 | void g4(const char* a, struct S* b, const char *c, struct S* d) {} |
| 20 | // CHECK: "\01?g4@@YAXPBDPAUS@@01@Z" |
| 21 | |
| 22 | typedef void (*VoidFunc)(); |
| 23 | |
| 24 | void foo_ptr(const char* a, const char* b, VoidFunc c, VoidFunc d) {} |
| 25 | // CHECK: @"\01?foo_ptr@@YAXPBD0P6AXXZ1@Z" |
| 26 | |
| 27 | // Make sure that different aliases of built-in types end up mangled as the |
| 28 | // built-ins. |
| 29 | typedef unsigned int uintptr_t; |
| 30 | typedef unsigned int size_t; |
| 31 | void *h(size_t a, uintptr_t b) {} |
| 32 | // CHECK: "\01?h@@YAPAXII@Z" |