summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/class-layout.cpp
blob: 6675b4963bd29d0576f45316e0556657fef5df3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s

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

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

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