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 Sambucstruct 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