Fariborz Jahanian | a636299 | 2009-10-21 18:38:00 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -emit-llvm -o - %s |
| 2 | |
| 3 | extern "C" int printf(...); |
| 4 | |
Fariborz Jahanian | 3976295 | 2009-10-21 21:01:47 +0000 | [diff] [blame] | 5 | struct V { |
| 6 | double d; |
| 7 | int iV; |
| 8 | }; |
| 9 | |
| 10 | struct B : virtual V{ |
| 11 | double d; |
| 12 | int iB; |
| 13 | }; |
| 14 | |
| 15 | struct B1 : virtual V{ |
| 16 | double d; |
| 17 | int iB1; |
| 18 | }; |
| 19 | |
| 20 | class A : public B, public B1 { |
Fariborz Jahanian | a636299 | 2009-10-21 18:38:00 +0000 | [diff] [blame] | 21 | public: |
Fariborz Jahanian | a636299 | 2009-10-21 18:38:00 +0000 | [diff] [blame] | 22 | float f; |
| 23 | double d; |
| 24 | int Ai; |
| 25 | }; |
| 26 | |
| 27 | int main() |
| 28 | { |
| 29 | A a1; |
| 30 | int A::* pa = &A::Ai; |
| 31 | float A::* pf = &A::f; |
| 32 | double A::* pd = &A::d; |
| 33 | printf("%d %d %d\n", &A::Ai, &A::f, &A::d); |
Fariborz Jahanian | 3976295 | 2009-10-21 21:01:47 +0000 | [diff] [blame] | 34 | printf("%d\n", &A::B::iB); |
| 35 | printf("%d\n", &A::B1::iB1); |
| 36 | printf("%d\n", &A::f); |
| 37 | printf("%d\n", &A::B::iV); |
| 38 | printf("%d\n", &A::B1::iV); |
| 39 | printf("%d\n", &A::B::V::iV); |
| 40 | printf("%d\n", &A::B1::V::iV); |
Fariborz Jahanian | a636299 | 2009-10-21 18:38:00 +0000 | [diff] [blame] | 41 | // FIXME. NYI |
| 42 | // printf(" %d, %f, %f \n", a1.*pa, a1.f, a1.d); |
| 43 | } |