xref: /llvm-project/clang/test/CodeGenCXX/debug-info-composite-cc.cpp (revision 6c5f03a1b2d93c3f69cb9fc643f61bb0160bc753)
1 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone -triple %itanium_abi_triple %s -o - | FileCheck %s
2 
3 // Not trivially copyable because of the explicit destructor.
4 // CHECK-DAG: !DICompositeType({{.*}}, name: "RefDtor",{{.*}}flags: DIFlagTypePassByReference
5 struct RefDtor {
6   int i;
7   ~RefDtor() {}
8 } refDtor;
9 
10 // Not trivially copyable because of the explicit copy constructor.
11 // CHECK-DAG: !DICompositeType({{.*}}, name: "RefCopy",{{.*}}flags: DIFlagTypePassByReference
12 struct RefCopy {
13   int i;
14   RefCopy() = default;
15   RefCopy(RefCopy &Copy) {}
16 } refCopy;
17 
18 // Not trivially copyable because of the explicit move constructor.
19 // CHECK-DAG: !DICompositeType({{.*}}, name: "RefMove",{{.*}}flags: DIFlagTypePassByReference
20 struct RefMove {
21   int i;
22   RefMove() = default;
23   RefMove(RefMove &&Move) {}
24 } refMove;
25 
26 // POD-like type even though it defines a destructor.
27 // CHECK-DAG: !DICompositeType({{.*}}, name: "Podlike", {{.*}}flags: DIFlagTypePassByValue
28 struct Podlike {
29   int i;
30   Podlike() = default;
31   Podlike(Podlike &&Move) = default;
32   ~Podlike() = default;
33 } podlike;
34 
35 
36 // This is a POD type.
37 // CHECK-DAG: !DICompositeType({{.*}}, name: "Pod",{{.*}}flags: DIFlagTypePassByValue
38 struct Pod {
39   int i;
40 } pod;
41 
42 // This is definitely not a POD type.
43 // CHECK-DAG: !DICompositeType({{.*}}, name: "Complex",{{.*}}flags: DIFlagTypePassByReference
44 struct Complex {
45   Complex() {}
46   Complex(Complex &Copy) : i(Copy.i) {};
47   int i;
48 } complex;
49