diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-01 02:09:07 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-01 02:09:07 +0000 |
commit | 528499bb44e2229709d3bc6a04c8700c083e65d0 (patch) | |
tree | 1544912d657b5ac0d21a3678e60d17ff7ebbc041 /clang/test/CXX/special/class.copy/implicit-move-def.cpp | |
parent | 90da66bb6935c9733a6a45c3ddd705a8382427c2 (diff) | |
download | bcm5719-llvm-528499bb44e2229709d3bc6a04c8700c083e65d0.tar.gz bcm5719-llvm-528499bb44e2229709d3bc6a04c8700c083e65d0.zip |
When defining the implicit move assignment operator, don't perform
semantic analysis when taking the address of an xvalue. Instead, just
build the unary operator directly, since it's safe to do so (from the
IRgen and AST perspectives) for any glvalue. Fixes PR10822.
llvm-svn: 138935
Diffstat (limited to 'clang/test/CXX/special/class.copy/implicit-move-def.cpp')
-rw-r--r-- | clang/test/CXX/special/class.copy/implicit-move-def.cpp | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/clang/test/CXX/special/class.copy/implicit-move-def.cpp b/clang/test/CXX/special/class.copy/implicit-move-def.cpp index 84a41c4622f..1f91945b4a9 100644 --- a/clang/test/CXX/special/class.copy/implicit-move-def.cpp +++ b/clang/test/CXX/special/class.copy/implicit-move-def.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -emit-llvm -o - -std=c++0x %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -o - -std=c++0x %s | FileCheck -check-prefix=CHECK-ASSIGN %s +// RUN: %clang_cc1 -emit-llvm -o - -std=c++0x %s | FileCheck -check-prefix=CHECK-CTOR %s // construct @@ -55,30 +56,41 @@ void g() { d = D(); } +// PR10822 +struct I { + unsigned var[1]; +}; + +void h() { + I i; + i = I(); +} // move assignment ops -// CHECK: define linkonce_odr {{.*}} @_ZN1DaSEOS_ -// CHECK: call {{.*}} @_ZN1CaSEOS_ -// CHECK: call {{.*}} @_ZN1AaSEOS_ -// CHECK: call {{.*}} @_ZN1BaSEOS_ +// CHECK-ASSIGN: define linkonce_odr {{.*}} @_ZN1DaSEOS_ +// CHECK-ASSIGN: call {{.*}} @_ZN1CaSEOS_ +// CHECK-ASSIGN: call {{.*}} @_ZN1AaSEOS_ +// CHECK-ASSIGN: call {{.*}} @_ZN1BaSEOS_ // array loop -// CHECK: br i1 -// CHECK: call {{.*}} @_ZN1AaSEOS_ +// CHECK-ASSIGN: br i1 +// CHECK-ASSIGN: call {{.*}} @_ZN1AaSEOS_ -// CHECK: define linkonce_odr {{.*}} @_ZN1CaSEOS_ -// CHECK: call {{.*}} @_ZN1AaSEOS_ +// CHECK-ASSIGN: define linkonce_odr {{.*}} @_ZN1IaSEOS_ +// call void @llvm.memcpy. +// CHECK-ASSIGN: define linkonce_odr {{.*}} @_ZN1CaSEOS_ +// CHECK-ASSIGN: call {{.*}} @_ZN1AaSEOS_ // move ctors -// CHECK: define linkonce_odr void @_ZN1HC2EOS_ -// CHECK: call void @_ZN1GC2EOS_ -// CHECK: call void @_ZN1FC1EOS_ -// CHECK: call void @_ZN1EC1EOS_ +// CHECK-CTOR: define linkonce_odr void @_ZN1HC2EOS_ +// CHECK-CTOR: call void @_ZN1GC2EOS_ +// CHECK-CTOR: call void @_ZN1FC1EOS_ +// CHECK-CTOR: call void @_ZN1EC1EOS_ // array loop -// CHECK: br i1 -// CHECK: call void @_ZN1FC1EOS_ +// CHECK-CTOR: br i1 +// CHECK-CTOR: call void @_ZN1FC1EOS_ -// CHECK: define linkonce_odr void @_ZN1GC2EOS_ -// CHECK: call void @_ZN1EC1EOS_ +// CHECK-CTOR: define linkonce_odr void @_ZN1GC2EOS_ +// CHECK-CTOR: call void @_ZN1EC1EOS_ |