summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/alloca-align.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-02-09 02:48:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-02-09 02:48:28 +0000
commita7566f163ae322e478bd0ef1cc49978475549a02 (patch)
treeb63a5558c31c069d2582b74b49d82fb3af2a3e80 /clang/test/CodeGenCXX/alloca-align.cpp
parentc3adf44885d75326b607b1772c5d3618b7f91ae2 (diff)
downloadbcm5719-llvm-a7566f163ae322e478bd0ef1cc49978475549a02.tar.gz
bcm5719-llvm-a7566f163ae322e478bd0ef1cc49978475549a02.zip
IRgen: Add CreateMemTemp, for creating an temporary memory object for a particular type, and flood fill. - CreateMemTemp sets the alignment on the alloca correctly, which fixes a great many places in IRgen where we were doing the wrong thing.
- This fixes many many more places than the test case, but my feeling is we need to audit alignment systematically so I'm not inclined to try hard to test the individual fixes in this patch. If this bothers you, patches welcome! PR6240. llvm-svn: 95648
Diffstat (limited to 'clang/test/CodeGenCXX/alloca-align.cpp')
-rw-r--r--clang/test/CodeGenCXX/alloca-align.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/alloca-align.cpp b/clang/test/CodeGenCXX/alloca-align.cpp
new file mode 100644
index 00000000000..de6b34d0607
--- /dev/null
+++ b/clang/test/CodeGenCXX/alloca-align.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
+//
+// CHECK: alloca %struct.MemsetRange, align 16
+
+struct MemsetRange {
+ int Start, End;
+ unsigned Alignment;
+ int TheStores __attribute__((aligned(16)));
+};
+void foobar() {
+ (void) MemsetRange();
+}
OpenPOWER on IntegriCloud