aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/class-layout.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-07-27 17:10:54 +0000
committerAnders Carlsson <andersca@mac.com>2009-07-27 17:10:54 +0000
commit696798febaf1f69020cdf7474b91e71736c5aa69 (patch)
tree434dffae64ee55b07a724ad6ee70585dae79ce24 /test/CodeGenCXX/class-layout.cpp
parentabdad358b53d0efd1d89ea434b7078600a656d1f (diff)
Use the CGRecordLayoutBuilder even if there are no fields, because in C++ an empty class will have a padding byte.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/class-layout.cpp')
-rw-r--r--test/CodeGenCXX/class-layout.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/CodeGenCXX/class-layout.cpp b/test/CodeGenCXX/class-layout.cpp
new file mode 100644
index 0000000000..7255d3e4f9
--- /dev/null
+++ b/test/CodeGenCXX/class-layout.cpp
@@ -0,0 +1,5 @@
+// RUN: clang-cc %s -emit-llvm -o %t &&
+
+// An extra byte shoudl be allocated for an empty class.
+// RUN: grep '%.truct.A = type { i8 }' %t
+struct A { } a;