summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2012-10-02 14:26:08 +0000
committerAaron Ballman <aaron@aaronballman.com>2012-10-02 14:26:08 +0000
commite91c6be01e16c403ca0d566c1fbde0a3b080e504 (patch)
treec268942318b1b2967896dbc1a2887f10dccd6f76 /clang/test/CodeGen
parent30c01f25f1d053970690db17d47dbc3691fa011b (diff)
downloadbcm5719-llvm-e91c6be01e16c403ca0d566c1fbde0a3b080e504.tar.gz
bcm5719-llvm-e91c6be01e16c403ca0d566c1fbde0a3b080e504.zip
Allowing individual targets to determine whether a given calling convention is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs.
Fixes PR13782 llvm-svn: 165015
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/microsoft-call-conv-x64.c39
-rw-r--r--clang/test/CodeGen/microsoft-call-conv.c2
-rw-r--r--clang/test/CodeGen/stdcall-fastcall.c2
3 files changed, 41 insertions, 2 deletions
diff --git a/clang/test/CodeGen/microsoft-call-conv-x64.c b/clang/test/CodeGen/microsoft-call-conv-x64.c
new file mode 100644
index 00000000000..9a0aa59207d
--- /dev/null
+++ b/clang/test/CodeGen/microsoft-call-conv-x64.c
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm < %s | FileCheck %s
+
+void __fastcall f1(void);
+void __stdcall f2(void);
+void __fastcall f4(void) {
+// CHECK: define void @f4()
+ f1();
+// CHECK: call void @f1()
+}
+void __stdcall f5(void) {
+// CHECK: define void @f5()
+ f2();
+// CHECK: call void @f2()
+}
+
+// PR5280
+void (__fastcall *pf1)(void) = f1;
+void (__stdcall *pf2)(void) = f2;
+void (__fastcall *pf4)(void) = f4;
+void (__stdcall *pf5)(void) = f5;
+
+int main(void) {
+ f4(); f5();
+ // CHECK: call void @f4()
+ // CHECK: call void @f5()
+ pf1(); pf2(); pf4(); pf5();
+ // CHECK: call void %{{.*}}()
+ // CHECK: call void %{{.*}}()
+ // CHECK: call void %{{.*}}()
+ // CHECK: call void %{{.*}}()
+ return 0;
+}
+
+// PR7117
+void __stdcall f7(foo) int foo; {}
+void f8(void) {
+ f7(0);
+ // CHECK: call void @f7(i32 0)
+}
diff --git a/clang/test/CodeGen/microsoft-call-conv.c b/clang/test/CodeGen/microsoft-call-conv.c
index 390c3be05e6..64d10fb4f4f 100644
--- a/clang/test/CodeGen/microsoft-call-conv.c
+++ b/clang/test/CodeGen/microsoft-call-conv.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-pc-linux -emit-llvm < %s | FileCheck %s
void __fastcall f1(void);
void __stdcall f2(void);
diff --git a/clang/test/CodeGen/stdcall-fastcall.c b/clang/test/CodeGen/stdcall-fastcall.c
index 3de7b6727bc..2832e911231 100644
--- a/clang/test/CodeGen/stdcall-fastcall.c
+++ b/clang/test/CodeGen/stdcall-fastcall.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm < %s | FileCheck %s
void __attribute__((fastcall)) f1(void);
void __attribute__((stdcall)) f2(void);
OpenPOWER on IntegriCloud