virtual-base-ctor.cpp revision 161e40c150e1629fe2861bcfc82ea0dffc00b72f
1// RUN: %clang_cc1 %s -emit-llvm -o - -O2 | FileCheck %s 2// XFAIL: * 3 4struct B; 5extern B x; 6char y; 7typedef __typeof(sizeof(int)) size_t; 8struct A { int a; A() { y = ((size_t)this - (size_t)&x) / sizeof(void*); } }; 9struct B : virtual A { void* x; }; 10B x; 11 12// CHECK: @y = global i8 2 13