summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/ms_abi-sysv_abi.c
diff options
context:
space:
mode:
authorCharles Davis <cdavis5x@gmail.com>2013-08-30 04:39:01 +0000
committerCharles Davis <cdavis5x@gmail.com>2013-08-30 04:39:01 +0000
commitb5a214e4f37b6fb0edb88f752aa53277b9490005 (patch)
tree8aa31f2953f17572388cbd21707ca8c7aa20dc84 /clang/test/Sema/ms_abi-sysv_abi.c
parent2bc74c2887d7a67a70d13e58b9411087f4df77ed (diff)
downloadbcm5719-llvm-b5a214e4f37b6fb0edb88f752aa53277b9490005.tar.gz
bcm5719-llvm-b5a214e4f37b6fb0edb88f752aa53277b9490005.zip
Add ms_abi and sysv_abi attribute handling.
Based on a patch by Benno Rice! llvm-svn: 189644
Diffstat (limited to 'clang/test/Sema/ms_abi-sysv_abi.c')
-rw-r--r--clang/test/Sema/ms_abi-sysv_abi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Sema/ms_abi-sysv_abi.c b/clang/test/Sema/ms_abi-sysv_abi.c
new file mode 100644
index 00000000000..35a5fad9ceb
--- /dev/null
+++ b/clang/test/Sema/ms_abi-sysv_abi.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-pc-linux-gnu %s
+
+// CC qualifier can be applied only to functions
+int __attribute__((ms_abi)) var1; // expected-warning{{'ms_abi' only applies to function types; type here is 'int'}}
+int __attribute__((sysv_abi)) var2; // expected-warning{{'sysv_abi' only applies to function types; type here is 'int'}}
+
+// Different CC qualifiers are not compatible
+// FIXME: Should say 'sysv_abi' instead of 'cdecl'
+void __attribute__((ms_abi, sysv_abi)) foo3(void); // expected-error{{cdecl and ms_abi attributes are not compatible}}
+void __attribute__((ms_abi)) foo4(); // expected-note{{previous declaration is here}}
+void __attribute__((sysv_abi)) foo4(void); // expected-error{{function declared 'cdecl' here was previously declared 'ms_abi'}}
+
+void bar(int i, int j) __attribute__((ms_abi, cdecl)); // expected-error{{cdecl and ms_abi attributes are not compatible}}
+void bar2(int i, int j) __attribute__((sysv_abi, cdecl)); // no-error
OpenPOWER on IntegriCloud