summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/class-layout.cpp
blob: 9303bdaba8bc50ea35212ede28ca0ed9d778c872 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s

// An extra byte should be allocated for an empty class.
// CHECK: %struct.A = type { i8 }
struct A { } a;

// No need to add tail padding here.
// CHECK: %struct.B = type { i8*, i32 }
struct B { void *a; int b; } b;

// C should have a vtable pointer.
// CHECK: %struct.C = type { i32 (...)**, i32 }
struct C { virtual void f(); int a; } *c;
OpenPOWER on IntegriCloud