diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2015-08-07 23:25:47 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2015-08-07 23:25:47 +0000 |
commit | eeebc41b580cc5d77f22da312a8d413f96c63edd (patch) | |
tree | 2cf6d3f55f6887db3d90567788f2d51f4b547bfb /clang/test/CodeGen | |
parent | 0f51d1495738f0d30a3fc1d3fb1226c84c329ec5 (diff) | |
download | bcm5719-llvm-eeebc41b580cc5d77f22da312a8d413f96c63edd.tar.gz bcm5719-llvm-eeebc41b580cc5d77f22da312a8d413f96c63edd.zip |
AST: Implement mangling support for function types without a prototype.
Function types without prototypes can arise when mangling a function type
within an overloadable function in C. We mangle these as the absence of
any parameter types (not even an empty parameter list).
Differential Revision: http://reviews.llvm.org/D11848
llvm-svn: 244374
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r-- | clang/test/CodeGen/mangle-ms.c | 4 | ||||
-rw-r--r-- | clang/test/CodeGen/overloadable.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/CodeGen/mangle-ms.c b/clang/test/CodeGen/mangle-ms.c new file mode 100644 index 00000000000..0ad43d5e06c --- /dev/null +++ b/clang/test/CodeGen/mangle-ms.c @@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-win32 | FileCheck %s + +// CHECK: define void @"\01?f@@$$J0YAXP6AX@Z@Z" +__attribute__((overloadable)) void f(void (*x)()) {} diff --git a/clang/test/CodeGen/overloadable.c b/clang/test/CodeGen/overloadable.c index 8b40e4d7340..4946c6d9286 100644 --- a/clang/test/CodeGen/overloadable.c +++ b/clang/test/CodeGen/overloadable.c @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s // CHECK: _Z1fPA10_1X +// CHECK: _Z1fPFvE int __attribute__((overloadable)) f(int x) { return x; } float __attribute__((overloadable)) f(float x) { return x; } @@ -13,6 +14,8 @@ void __attribute__((overloadable)) f(struct X (*ptr)[10]) { } void __attribute__((overloadable)) f(int x, int y, ...) { } +void __attribute__((overloadable)) f(void (*x)()) {} + int main() { int iv = 17; float fv = 3.0f; |