summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/nrvo.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-11-11 03:57:31 +0000
committerJohn McCall <rjmccall@apple.com>2011-11-11 03:57:31 +0000
commit1cd76e8ca8f890a4defadcae3372c025ebe7607c (patch)
treed2dde090df58e7789a9dd698be3466d3e3d21f43 /test/CodeGenCXX/nrvo.cpp
parent538773cbfbba03b85d931efe122b743b7b0cc60d (diff)
Don't apply NRVO to over-aligned variables. The caller only
guarantees alignment up to the ABI alignment of the return type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/nrvo.cpp')
-rw-r--r--test/CodeGenCXX/nrvo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGenCXX/nrvo.cpp b/test/CodeGenCXX/nrvo.cpp
index 57bf27ab7a..4a117f1df0 100644
--- a/test/CodeGenCXX/nrvo.cpp
+++ b/test/CodeGenCXX/nrvo.cpp
@@ -147,3 +147,15 @@ X test5() {
}
}
#endif
+
+// rdar://problem/10430868
+// CHECK: define void @_Z5test6v
+X test6() {
+ X a __attribute__((aligned(8)));
+ return a;
+ // CHECK: [[A:%.*]] = alloca [[X:%.*]], align 8
+ // CHECK-NEXT: call void @_ZN1XC1Ev([[X]]* [[A]])
+ // CHECK-NEXT: call void @_ZN1XC1ERKS_([[X]]* {{%.*}}, [[X]]* [[A]])
+ // CHECK-NEXT: call void @_ZN1XD1Ev([[X]]* [[A]])
+ // CHECK-NEXT: ret void
+}