diff options
author | John McCall <rjmccall@apple.com> | 2011-11-11 03:57:31 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-11-11 03:57:31 +0000 |
commit | 03318c1dcff689f51371dc4111aaa23e2b9ab4c5 (patch) | |
tree | 4880115140dc5da1c733aa4d71f8f5217d8b0af3 /clang/test/CodeGenCXX/nrvo.cpp | |
parent | f1a3c2aee1de6af989d52acf631b50713597e69d (diff) | |
download | bcm5719-llvm-03318c1dcff689f51371dc4111aaa23e2b9ab4c5.tar.gz bcm5719-llvm-03318c1dcff689f51371dc4111aaa23e2b9ab4c5.zip |
Don't apply NRVO to over-aligned variables. The caller only
guarantees alignment up to the ABI alignment of the return type.
llvm-svn: 144364
Diffstat (limited to 'clang/test/CodeGenCXX/nrvo.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/nrvo.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/nrvo.cpp b/clang/test/CodeGenCXX/nrvo.cpp index 57bf27ab7af..4a117f1df09 100644 --- a/clang/test/CodeGenCXX/nrvo.cpp +++ b/clang/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 +} |