Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - -O2 | FileCheck %s |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 2 | |
3 | struct B; | ||||
4 | extern B x; | ||||
5 | char y; | ||||
6 | typedef __typeof(sizeof(int)) size_t; | ||||
7 | struct A { int a; A() { y = ((size_t)this - (size_t)&x) / sizeof(void*); } }; | ||||
8 | struct B : virtual A { void* x; }; | ||||
9 | B x; | ||||
10 | |||||
11 | // CHECK: @y = global i8 2 |