1 // Check that in case of copying an array of memcpy-able objects, their
2 // destructors will be called if an exception is thrown.
4 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fexceptions -fcxx-exceptions -O0 -fno-elide-constructors -std=c++98 -emit-llvm %s -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK98 %s
5 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fexceptions -fcxx-exceptions -O0 -fno-elide-constructors -std=c++11 -emit-llvm %s -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK11 %s
9 ImplicitCopy() { x
= 10; }
10 ~ImplicitCopy() { x
= 20; }
15 ThrowCopy(const ThrowCopy
&) { throw 1; }
27 // CHECK-NOT: call void @_ZN9ThrowCopyC1ERKS_
28 // CHECK: invoke void @_ZN9ThrowCopyC1ERKS_
29 // CHECK98: invoke void @_ZN12ImplicitCopyD1Ev
30 // CHECK11: call void @_ZN12ImplicitCopyD1Ev