opnsense-src/test/CodeGenCXX/class-layout.cpp

14 lines
390 B
C++
Raw Normal View History

2010-01-01 05:34:51 -05:00
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2009-10-14 14:03:49 -04:00
// An extra byte shoudl be allocated for an empty class.
2009-12-15 13:49:47 -05:00
// CHECK: %struct.A = type { i8 }
2009-10-14 14:03:49 -04:00
struct A { } a;
2009-12-15 13:49:47 -05:00
// No need to add tail padding here.
// CHECK: %struct.B = type { i8*, i32 }
struct B { void *a; int b; } b;
2010-01-01 05:34:51 -05:00
// C should have a vtable pointer.
// CHECK: %struct.C = type { i8**, i32 }
struct C { virtual void f(); int a; } *c;