1 // Check that destructors of memcpy-able struct members are called properly
2 // during stack unwinding after an exception.
4 // Check that destructor's argument (address of member to be destroyed) is
5 // obtained by taking offset from struct, not by bitcasting pointers.
7 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -O0 -fno-elide-constructors -emit-llvm %s -o - | FileCheck %s
11 ImplicitCopy() { id
= 10; }
12 ~ImplicitCopy() { id
= 20; }
17 ThrowCopy() { id
= 15; }
18 ThrowCopy(const ThrowCopy
&x
) {
22 ~ThrowCopy() { id
= 35; }
30 Container() { id
= 1000; }
31 ~Container() { id
= 2000; }
38 // CHECK: %{{.+}} = getelementptr inbounds %struct.Container, ptr %{{.+}}, i32 0, i32 1