[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGenCXX / no-unique-address-2.cpp
blobc524a70b5a4351bfe6654830e123164c34178359
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 &&) {}
9 };
11 struct Foo {
12 int i;
13 [[no_unique_address]] TriviallyCopyable m;
14 [[no_unique_address]] NonTriviallyCopyable n;
17 void call() {
18 Foo foo;
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_