mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 04:36:07 +00:00

Generating call assume(icmp %vtable, %global_vtable) after constructor call for devirtualization purposes. For more info go to: http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html Edit: Fixed version because of PR24479. http://reviews.llvm.org/D11859 llvm-svn: 246213
12 lines
331 B
C++
12 lines
331 B
C++
// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - -O2 | opt - -S -globalopt -o - | FileCheck %s
|
|
|
|
struct B;
|
|
extern B x;
|
|
char y;
|
|
typedef __typeof(sizeof(int)) size_t;
|
|
struct A { int a; A() { y = ((size_t)this - (size_t)&x) / sizeof(void*); } };
|
|
struct B : virtual A { void* x; };
|
|
B x;
|
|
|
|
// CHECK: @y = global i8 2
|