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
diff --git a/test/CodeGenCXX/nrvo.cpp b/test/CodeGenCXX/nrvo.cpp
index 57bf27a..4a117f1 100644
--- a/test/CodeGenCXX/nrvo.cpp
+++ b/test/CodeGenCXX/nrvo.cpp
@@ -147,3 +147,15 @@
   }
 }
 #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
+}