diff options
author | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /test/CodeGenCXX/ms_struct.cpp | |
parent | 38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff) | |
download | FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz |
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/CodeGenCXX/ms_struct.cpp')
-rw-r--r-- | test/CodeGenCXX/ms_struct.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/CodeGenCXX/ms_struct.cpp b/test/CodeGenCXX/ms_struct.cpp new file mode 100644 index 0000000..32307ba --- /dev/null +++ b/test/CodeGenCXX/ms_struct.cpp @@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s + +// rdar://20636558 + +#pragma GCC diagnostic ignored "-Wincompatible-ms-struct" +#define ATTR __attribute__((__ms_struct__)) + +struct ATTR VBase { + virtual void foo() = 0; +}; + +struct ATTR Base : virtual VBase { + virtual void bar() = 0; +}; + +struct ATTR Derived : Base { + Derived(); + void foo(); + void bar(); + int value; +}; + +// CHECK: [[DERIVED:%.*]] = type <{ [[BASE:%.*]], i32, [4 x i8] }> +// CHECK: [[BASE]] = type { [[VBASE:%.*]] } +// CHECK: [[VBASE]] = type { i32 (...)** } + +// CHECK: define void @_ZN7DerivedC2Ev +// CHECK: [[SELF:%.*]] = load [[DERIVED]]* +// CHECK: [[T0:%.*]] = bitcast [[DERIVED]]* [[SELF]] to [[BASE]]* +// CHECK: call void @_ZN4BaseC2Ev([[BASE]]* [[T0]], i8** +// CHECK: [[T0:%.*]] = getelementptr inbounds {{.*}} [[SELF]], i32 0, i32 1 +// CHECK: store i32 20, i32* [[T0]], +Derived::Derived() : value(20) {} |