blob: dfdb786b18ee7b03d1f8432e4b2958675d63a9b9 [file] [log] [blame]
Anders Carlsson14e82fd2011-02-06 18:31:40 +00001// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -O3 -o - | FileCheck %s
2
3// Check that we don't assert on this case.
4namespace Test1 {
5
6struct Incomplete;
7
8struct A {
9 virtual void f();
10 virtual void g(Incomplete);
11 virtual void h();
12 virtual void i();
13 int a;
14};
15
16struct B {
17 virtual void f();
18 virtual void g(Incomplete);
19 virtual void h();
20 virtual void i();
21 int b;
22};
23
24struct C : A, B {
25 C();
26
27 virtual void f();
28 virtual void g(Incomplete);
29 virtual void h();
30 virtual void i();
31};
32
33void C::h() { }
34
35C::C() { }
36
37void C::i() { }
38
39}
40
41namespace Test2 {
42
43struct A {
44 virtual void f();
45 int a;
46};
47
48struct B {
49 virtual void f();
50 int b;
51};
52
53struct C : A, B {
54 virtual void f();
55};
56
57static void f(B* b) {
58 b->f();
59}
60
61// CHECK: define void @_ZN5Test21fEv()
62// CHECK: call void @_ZN5Test21C1fEv
63// CHECK: ret void
64// CHECK: define available_externally void @_ZThn16_N5Test21C1fEv
65void f() {
66 C c;
67 f(&c);
68}
69
70}
Anders Carlsson22df7b12011-02-06 20:09:44 +000071
72// Test that we don't assert.
73namespace Test3 {
74
75struct A {
76 virtual ~A();
77
78 int a;
79};
80
81struct B : A { };
82struct C : virtual B { };
83
84void f() {
85 C c;
86}
87
88}