1 // Check that initialization of the only one memcpy-able struct member will not
2 // be performed twice after successful non-trivial initializtion of the second
5 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -O0 -fno-elide-constructors -emit-llvm %s -o - | FileCheck %s
12 ImplicitCopy() { id
= 10; }
13 ~ImplicitCopy() { id
= 20; }
19 ExplicitCopy() { id
= 15; }
20 ExplicitCopy(const ExplicitCopy
&x
) { id
= 25; }
21 ~ExplicitCopy() { id
= 35; }
25 ImplicitCopy o1
; // memcpy-able member.
26 ExplicitCopy o2
; // non-trivial initialization.
28 Container() { globId
= 1000; }
29 ~Container() { globId
= 2000; }
35 // CHECK-DAG: call void @llvm.memcpy
36 // CHECK-DAG: declare void @llvm.memcpy
37 // CHECK-NOT: @llvm.memcpy