diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-21 02:52:27 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-21 02:52:27 +0000 |
commit | 73af5c6dda372199e21ae1cc57749e8915e37f77 (patch) | |
tree | 1e34488c3db4e95c46d178cab4adff6f781877fc /clang/test/CodeGenCXX/mangle-ms-back-references.cpp | |
parent | 88973313818229ac87616fd604c5309027ffefb1 (diff) | |
download | bcm5719-llvm-73af5c6dda372199e21ae1cc57749e8915e37f77.tar.gz bcm5719-llvm-73af5c6dda372199e21ae1cc57749e8915e37f77.zip |
MS: Mangle rvalue references and nullptr_t, and produce back-references when
appropriate. Patch by João Matos!
llvm-svn: 158895
Diffstat (limited to 'clang/test/CodeGenCXX/mangle-ms-back-references.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/mangle-ms-back-references.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/mangle-ms-back-references.cpp b/clang/test/CodeGenCXX/mangle-ms-back-references.cpp new file mode 100644 index 00000000000..fdfb3b5bf21 --- /dev/null +++ b/clang/test/CodeGenCXX/mangle-ms-back-references.cpp @@ -0,0 +1,32 @@ +// RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s + +void f1(const char* a, const char* b) {} +// CHECK: "\01?f1@@YAXPBD0@Z" + +void f2(const char* a, char* b) {} +// CHECK: "\01?f2@@YAXPBDPAD@Z" + +void f3(int a, const char* b, const char* c) {} +// CHECK: "\01?f3@@YAXHPBD0@Z" + +const char *f4(const char* a, const char* b) {} +// CHECK: "\01?f4@@YAPBDPBD0@Z" + +// FIXME: tests for more than 10 types? + +struct S {}; + +void g4(const char* a, struct S* b, const char *c, struct S* d) {} +// CHECK: "\01?g4@@YAXPBDPAUS@@01@Z" + +typedef void (*VoidFunc)(); + +void foo_ptr(const char* a, const char* b, VoidFunc c, VoidFunc d) {} +// CHECK: @"\01?foo_ptr@@YAXPBD0P6AXXZ1@Z" + +// 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; +void *h(size_t a, uintptr_t b) {} +// CHECK: "\01?h@@YAPAXII@Z" |