blob: d4d4046105e143f0fd3706cde84f8936b1807c9f [file] [log] [blame]
Adrian Prantl6c5f03a2018-01-05 01:13:52 +00001// 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
5struct 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
12struct RefCopy {
13 int i;
14 RefCopy() = default;
15 RefCopy(RefCopy &Copy) {}
16} refCopy;
17
Adrian Prantl6c5f03a2018-01-05 01:13:52 +000018// POD-like type even though it defines a destructor.
19// CHECK-DAG: !DICompositeType({{.*}}, name: "Podlike", {{.*}}flags: DIFlagTypePassByValue
20struct Podlike {
21 int i;
22 Podlike() = default;
23 Podlike(Podlike &&Move) = default;
24 ~Podlike() = default;
25} podlike;
26
27
28// This is a POD type.
29// CHECK-DAG: !DICompositeType({{.*}}, name: "Pod",{{.*}}flags: DIFlagTypePassByValue
30struct Pod {
31 int i;
32} pod;
33
34// This is definitely not a POD type.
35// CHECK-DAG: !DICompositeType({{.*}}, name: "Complex",{{.*}}flags: DIFlagTypePassByReference
36struct Complex {
37 Complex() {}
38 Complex(Complex &Copy) : i(Copy.i) {};
39 int i;
40} complex;
Adrian Prantl69fce122018-03-08 23:11:46 +000041
42// This type is manually marked as trivial_abi.
43// CHECK-DAG: !DICompositeType({{.*}}, name: "Marked",{{.*}}flags: DIFlagTypePassByValue
44struct __attribute__((trivial_abi)) Marked {
45 int *p;
46 Marked();
47 ~Marked();
48 Marked(const Marked &) noexcept;
49 Marked &operator=(const Marked &);
50} marked;