1 // RUN: %clang_cc1 -std=c++2a %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s
3 struct TriviallyCopyable
{};
5 struct NonTriviallyCopyable
{
6 NonTriviallyCopyable() = default;
7 NonTriviallyCopyable(const NonTriviallyCopyable
&) = default;
8 NonTriviallyCopyable(NonTriviallyCopyable
&&) {}
13 [[no_unique_address
]] TriviallyCopyable m
;
14 [[no_unique_address
]] NonTriviallyCopyable n
;
19 Foo
foo2(static_cast<Foo
&&>(foo
));
22 // The memcpy call should copy exact 4 bytes for member 'int i'
23 // CHECK: define {{.*}} void @_ZN3FooC2EOS_
24 // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr {{.+}}, ptr {{.+}}, i64 4, i1 false)
25 // CHECK: call void @_ZN20NonTriviallyCopyableC2EOS_