1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm-only -O3 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc // Check that we don't assert on this case. 4*f4a2713aSLionel Sambuc namespace Test1 { 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel Sambuc struct Incomplete; 7*f4a2713aSLionel Sambuc 8*f4a2713aSLionel Sambuc struct A { 9*f4a2713aSLionel Sambuc virtual void f(); 10*f4a2713aSLionel Sambuc virtual void g(Incomplete); 11*f4a2713aSLionel Sambuc virtual void h(); 12*f4a2713aSLionel Sambuc virtual void i(); 13*f4a2713aSLionel Sambuc int a; 14*f4a2713aSLionel Sambuc }; 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel Sambuc struct B { 17*f4a2713aSLionel Sambuc virtual void f(); 18*f4a2713aSLionel Sambuc virtual void g(Incomplete); 19*f4a2713aSLionel Sambuc virtual void h(); 20*f4a2713aSLionel Sambuc virtual void i(); 21*f4a2713aSLionel Sambuc int b; 22*f4a2713aSLionel Sambuc }; 23*f4a2713aSLionel Sambuc 24*f4a2713aSLionel Sambuc struct C : A, B { 25*f4a2713aSLionel Sambuc C(); 26*f4a2713aSLionel Sambuc 27*f4a2713aSLionel Sambuc virtual void f(); 28*f4a2713aSLionel Sambuc virtual void g(Incomplete); 29*f4a2713aSLionel Sambuc virtual void h(); 30*f4a2713aSLionel Sambuc virtual void i(); 31*f4a2713aSLionel Sambuc }; 32*f4a2713aSLionel Sambuc h()33*f4a2713aSLionel Sambucvoid C::h() { } 34*f4a2713aSLionel Sambuc C()35*f4a2713aSLionel SambucC::C() { } 36*f4a2713aSLionel Sambuc i()37*f4a2713aSLionel Sambucvoid C::i() { } 38*f4a2713aSLionel Sambuc 39*f4a2713aSLionel Sambuc } 40*f4a2713aSLionel Sambuc 41*f4a2713aSLionel Sambuc namespace Test2 { 42*f4a2713aSLionel Sambuc 43*f4a2713aSLionel Sambuc struct A { 44*f4a2713aSLionel Sambuc virtual void f(); 45*f4a2713aSLionel Sambuc int a; 46*f4a2713aSLionel Sambuc }; 47*f4a2713aSLionel Sambuc 48*f4a2713aSLionel Sambuc struct B { 49*f4a2713aSLionel Sambuc virtual void f(); 50*f4a2713aSLionel Sambuc int b; 51*f4a2713aSLionel Sambuc }; 52*f4a2713aSLionel Sambuc 53*f4a2713aSLionel Sambuc struct C : A, B { 54*f4a2713aSLionel Sambuc virtual void f(); 55*f4a2713aSLionel Sambuc }; 56*f4a2713aSLionel Sambuc f(B * b)57*f4a2713aSLionel Sambucstatic void f(B* b) { 58*f4a2713aSLionel Sambuc b->f(); 59*f4a2713aSLionel Sambuc } 60*f4a2713aSLionel Sambuc 61*f4a2713aSLionel Sambuc } 62*f4a2713aSLionel Sambuc 63*f4a2713aSLionel Sambuc // Test that we don't assert. 64*f4a2713aSLionel Sambuc namespace Test3 { 65*f4a2713aSLionel Sambuc 66*f4a2713aSLionel Sambuc struct A { 67*f4a2713aSLionel Sambuc virtual ~A(); 68*f4a2713aSLionel Sambuc 69*f4a2713aSLionel Sambuc int a; 70*f4a2713aSLionel Sambuc }; 71*f4a2713aSLionel Sambuc 72*f4a2713aSLionel Sambuc struct B : A { }; 73*f4a2713aSLionel Sambuc struct C : virtual B { }; 74*f4a2713aSLionel Sambuc f()75*f4a2713aSLionel Sambucvoid f() { 76*f4a2713aSLionel Sambuc C c; 77*f4a2713aSLionel Sambuc } 78*f4a2713aSLionel Sambuc 79*f4a2713aSLionel Sambuc } 80