[cfe-commits] r61436 - /cfe/trunk/test/Sema/stdcall-fastcall.c

Anton Korobeynikov asl at math.spbu.ru
Thu Dec 25 16:51:22 PST 2008

Author: asl
Date: Thu Dec 25 18:51:21 2008
New Revision: 61436

URL: http://llvm.org/viewvc/llvm-project?rev=61436&view=rev
Testcase for stdcall/fastcall sema checks.
Patch by Ilya Okonsky!


Added: cfe/trunk/test/Sema/stdcall-fastcall.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/stdcall-fastcall.c?rev=61436&view=auto

--- cfe/trunk/test/Sema/stdcall-fastcall.c (added)
+++ cfe/trunk/test/Sema/stdcall-fastcall.c Thu Dec 25 18:51:21 2008
@@ -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();

More information about the cfe-commits mailing list