xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/virtual-base-ctor.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - -O2 | FileCheck %s
2f4a2713aSLionel Sambuc 
3f4a2713aSLionel Sambuc struct B;
4f4a2713aSLionel Sambuc extern B x;
5f4a2713aSLionel Sambuc char y;
6f4a2713aSLionel Sambuc typedef __typeof(sizeof(int)) size_t;
AA7f4a2713aSLionel Sambuc struct A { int a; A() { y = ((size_t)this - (size_t)&x) / sizeof(void*); } };
8f4a2713aSLionel Sambuc struct B : virtual A { void* x; };
9f4a2713aSLionel Sambuc B x;
10f4a2713aSLionel Sambuc 
11f4a2713aSLionel Sambuc // CHECK: @y = global i8 2
12