summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/virtual-override-x64.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
committerdim <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
commitc72c57c9e9b69944e3e009cd5e209634839581d3 (patch)
tree4fc2f184c499d106f29a386c452b49e5197bf63d /test/SemaCXX/virtual-override-x64.cpp
parent5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff)
downloadFreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip
FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/SemaCXX/virtual-override-x64.cpp')
-rw-r--r--test/SemaCXX/virtual-override-x64.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/SemaCXX/virtual-override-x64.cpp b/test/SemaCXX/virtual-override-x64.cpp
new file mode 100644
index 0000000..8d5aad8
--- /dev/null
+++ b/test/SemaCXX/virtual-override-x64.cpp
@@ -0,0 +1,36 @@
+// RUN: %clang_cc1 -triple=x86_64-pc-unknown -fsyntax-only -verify %s
+
+// Non-x86 targets ignore the calling conventions by default (but will warn
+// when one is encountered), so we want to make sure the virtual overrides
+// continue to work.
+namespace PR14339 {
+ class A {
+ public:
+ virtual void __attribute__((thiscall)) f(); // expected-warning {{calling convention 'thiscall' ignored for this target}}
+ };
+
+ class B : public A {
+ public:
+ void __attribute__((cdecl)) f();
+ };
+
+ class C : public A {
+ public:
+ void __attribute__((thiscall)) f(); // expected-warning {{calling convention 'thiscall' ignored for this target}}
+ };
+
+ class D : public A {
+ public:
+ void f();
+ };
+
+ class E {
+ public:
+ virtual void __attribute__((stdcall)) g(); // expected-warning {{calling convention 'stdcall' ignored for this target}}
+ };
+
+ class F : public E {
+ public:
+ void g();
+ };
+}
OpenPOWER on IntegriCloud