summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/MicrosoftCompatibility-x64.c
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/Sema/MicrosoftCompatibility-x64.c
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/Sema/MicrosoftCompatibility-x64.c')
-rw-r--r--clang/test/Sema/MicrosoftCompatibility-x64.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Sema/MicrosoftCompatibility-x64.c b/clang/test/Sema/MicrosoftCompatibility-x64.c
new file mode 100644
index 00000000000..bf595af6993
--- /dev/null
+++ b/clang/test/Sema/MicrosoftCompatibility-x64.c
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-compatibility -triple x86_64-pc-win32
+int __stdcall f(void); /* expected-warning {{calling convention '__stdcall' ignored for this target}} */
+
+/* This should compile without warning because __stdcall is treated
+as __cdecl in MS compatibility mode for x64 compiles*/
+int __cdecl f(void) {
+ return 0;
+}
OpenPOWER on IntegriCloud