Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / debug-info-composite-cc.cpp
blobd4d4046105e143f0fd3706cde84f8936b1807c9f
1 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone -triple %itanium_abi_triple %s -o - | FileCheck %s
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;
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;
18 // POD-like type even though it defines a destructor.
19 // CHECK-DAG: !DICompositeType({{.*}}, name: "Podlike", {{.*}}flags: DIFlagTypePassByValue
20 struct Podlike {
21 int i;
22 Podlike() = default;
23 Podlike(Podlike &&Move) = default;
24 ~Podlike() = default;
25 } podlike;
28 // This is a POD type.
29 // CHECK-DAG: !DICompositeType({{.*}}, name: "Pod",{{.*}}flags: DIFlagTypePassByValue
30 struct Pod {
31 int i;
32 } pod;
34 // This is definitely not a POD type.
35 // CHECK-DAG: !DICompositeType({{.*}}, name: "Complex",{{.*}}flags: DIFlagTypePassByReference
36 struct Complex {
37 Complex() {}
38 Complex(Complex &Copy) : i(Copy.i) {};
39 int i;
40 } complex;
42 // This type is manually marked as trivial_abi.
43 // CHECK-DAG: !DICompositeType({{.*}}, name: "Marked",{{.*}}flags: DIFlagTypePassByValue
44 struct __attribute__((trivial_abi)) Marked {
45 int *p;
46 Marked();
47 ~Marked();
48 Marked(const Marked &) noexcept;
49 Marked &operator=(const Marked &);
50 } marked;