summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/unaligned.cpp
diff options
context:
space:
mode:
authorRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2017-03-08 14:00:44 +0000
committerRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2017-03-08 14:00:44 +0000
commit3fa38a14acca2ee81b2ee724d2bf1197d20494cf (patch)
tree76ff6316a206013d7dd35214c688e85ea4029369 /clang/test/CodeGenCXX/unaligned.cpp
parent0385ccb34abc6dd378848a6d7355a39ef06e3f40 (diff)
downloadbcm5719-llvm-3fa38a14acca2ee81b2ee724d2bf1197d20494cf.tar.gz
bcm5719-llvm-3fa38a14acca2ee81b2ee724d2bf1197d20494cf.zip
Honor __unaligned in codegen for declarations and expressions
This patch honors the unaligned type qualifier (currently available through he keyword __unaligned and -fms-extensions) in CodeGen. In the current form the patch affects declarations and expressions. It does not affect fields of classes. Differential Revision: https://reviews.llvm.org/D30166 llvm-svn: 297276
Diffstat (limited to 'clang/test/CodeGenCXX/unaligned.cpp')
-rw-r--r--clang/test/CodeGenCXX/unaligned.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/unaligned.cpp b/clang/test/CodeGenCXX/unaligned.cpp
new file mode 100644
index 00000000000..95549d3339f
--- /dev/null
+++ b/clang/test/CodeGenCXX/unaligned.cpp
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -x c++ -std=c++11 -triple x86_64-unknown-linux-gnu -fms-extensions -emit-llvm < %s | FileCheck %s
+
+int foo() {
+ // CHECK: ret i32 1
+ return alignof(__unaligned int);
+}
OpenPOWER on IntegriCloud