summaryrefslogtreecommitdiff
path: root/test/Sema/stdcall-fastcall.c
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-12-26 00:51:21 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-12-26 00:51:21 +0000
commit7f7bb72fd0fcfc315245e811debb507f1f55456b (patch)
tree29626c4dbf86a1c0edcfcf537e6466ab93a8971a /test/Sema/stdcall-fastcall.c
parent92d66868a1d446a3878cbb2373679c05cbc14045 (diff)
downloadclang-7f7bb72fd0fcfc315245e811debb507f1f55456b.tar.gz
Testcase for stdcall/fastcall sema checks.
Patch by Ilya Okonsky! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/stdcall-fastcall.c')
-rw-r--r--test/Sema/stdcall-fastcall.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Sema/stdcall-fastcall.c b/test/Sema/stdcall-fastcall.c
new file mode 100644
index 0000000000..3a222dd4bc
--- /dev/null
+++ b/test/Sema/stdcall-fastcall.c
@@ -0,0 +1,12 @@
+// RUN: clang -fsyntax-only -verify %s
+
+// CC qualifier can be applied only to functions
+int __attribute__((stdcall)) var1; // expected-warning{{'stdcall' attribute only applies to function types}}
+int __attribute__((fastcall)) var2; // expected-warning{{'fastcall' attribute only applies to function types}}
+
+// Different CC qualifiers are not compatible
+void __attribute__((stdcall, fastcall)) foo3(); // expected-error{{stdcall and fastcall attributes are not compatible}}
+
+// FIXME: Something went wrong recently and diagnostics is not generated anymore
+void __attribute__((stdcall)) foo4();
+void __attribute__((fastcall)) foo4();