summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/mrtd.c
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-08-27 23:08:25 +0000
committerReid Kleckner <reid@kleckner.net>2013-08-27 23:08:25 +0000
commit78af0708b7d3b1d7a3189c39541c91cf9cb6d3f7 (patch)
tree390ae44b40f830581cf98ffae4be55c7480f9d0b /clang/test/CodeGen/mrtd.c
parent8f4524a7282aefe99ba42b92f9708c3d94232215 (diff)
downloadbcm5719-llvm-78af0708b7d3b1d7a3189c39541c91cf9cb6d3f7.tar.gz
bcm5719-llvm-78af0708b7d3b1d7a3189c39541c91cf9cb6d3f7.zip
Delete CC_Default and use the target default CC everywhere
Summary: Makes functions with implicit calling convention compatible with function types with a matching explicit calling convention. This fixes things like calls to qsort(), which has an explicit __cdecl attribute on the comparator in Windows headers. Clang will now infer the calling convention from the declarator. There are two cases when the CC must be adjusted during redeclaration: 1. When defining a non-inline static method. 2. When redeclaring a function with an implicit or mismatched convention. Fixes PR13457, and allows clang to compile CommandLine.cpp for the Microsoft C++ ABI. Excellent test cases provided by Alexander Zinenko! Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1231 llvm-svn: 189412
Diffstat (limited to 'clang/test/CodeGen/mrtd.c')
-rw-r--r--clang/test/CodeGen/mrtd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/CodeGen/mrtd.c b/clang/test/CodeGen/mrtd.c
index a40a59ac0fc..8fa7cf02cea 100644
--- a/clang/test/CodeGen/mrtd.c
+++ b/clang/test/CodeGen/mrtd.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -mrtd -triple i386-unknown-freebsd9.0 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -mrtd -triple i386-unknown-unknown -std=c89 -emit-llvm -o - %s | FileCheck %s
void baz(int arg);
@@ -14,4 +14,13 @@ void foo(int arg) {
// CHECK: declare x86_stdcallcc void @baz(i32)
+void qux(int arg, ...) { }
+// CHECK: define void @qux(i32 %arg, ...)
+
+void quux(int a1, int a2, int a3) {
+ qux(a1, a2, a3);
+}
+// CHECK-LABEL: define x86_stdcallcc void @quux
+// CHECK: call void (i32, ...)* @qux
+
// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
OpenPOWER on IntegriCloud