1 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone -triple %itanium_abi_triple %s -o - | FileCheck %s
3 // Cases to show some non-trivial types with flags combined with DIFlagNonTrivial and DIFlagTypePassByValue.
5 // CHECK-DAG: !DICompositeType({{.*}}, name: "Explicit",{{.*}}flags: DIFlagTypePassByValue | DIFlagNonTrivial
11 // CHECK-DAG: !DICompositeType({{.*}}, name: "Struct",{{.*}}flags: DIFlagTypePassByValue | DIFlagNonTrivial
16 // CHECK-DAG: !DICompositeType({{.*}}, name: "Annotated",{{.*}}flags: DIFlagTypePassByValue | DIFlagNonTrivial
17 struct __attribute__((trivial_abi
)) Annotated
{
22 // Check a non-composite type
23 // CHECK-DAG: !DIGlobalVariable(name: "GlobalVar", {{.*}}type: {{.*}}, isLocal: false, isDefinition: true)
26 // Cases to test composite type's triviality
28 // CHECK-DAG: {{.*}}!DIGlobalVariable(name: "Union",
29 // CHECK-DAG-NEXT: {{^((?!\bDIFlagNonTrivial\b).)*$}}
34 // CHECK-DAG: {{.*}}!DIGlobalVariable(name: "Trivial",
35 // CHECK-DAG-NEXT: {{^((?!\bDIFlagNonTrivial\b).)*$}}
40 // CHECK-DAG: {{.*}}!DIGlobalVariable(name: "TrivialA",
41 // CHECK-DAG-NEXT: {{^((?!\bDIFlagNonTrivial\b).)*$}}
46 // CHECK-DAG: {{.*}}!DIGlobalVariable(name: "TrivialB",
47 // CHECK-DAG-NEXT: {{^((?!\bDIFlagNonTrivial\b).)*$}}
50 TrivialB(int x
) { m
= x
; }
54 // CHECK-DAG: {{.*}}!DIGlobalVariable(name: "TrivialC",
55 // CHECK-DAG-NEXT: {{^((?!\bDIFlagNonTrivial\b).)*$}}
60 // CHECK-DAG: {{.*}}!DIGlobalVariable(name: "TrivialD",
61 // CHECK-DAG-NEXT: {{^((?!\bDIFlagNonTrivial\b).)*$}}
66 static struct NT x
; // Member is non-trivial but is static.
70 // CHECK-DAG: !DICompositeType({{.*}}, name: "NonTrivial",{{.*}}flags: {{.*}}DIFlagNonTrivial
75 // CHECK-DAG: !DICompositeType({{.*}}, name: "NonTrivialA",{{.*}}flags: {{.*}}DIFlagNonTrivial
80 // CHECK-DAG: !DICompositeType({{.*}}, name: "NonTrivialB",{{.*}}flags: {{.*}}DIFlagNonTrivial
85 // CHECK-DAG: !DICompositeType({{.*}}, name: "NonTrivialC",{{.*}}flags: {{.*}}DIFlagNonTrivial
90 // CHECK-DAG: !DICompositeType({{.*}}, name: "NonTrivialD",{{.*}}flags: {{.*}}DIFlagNonTrivial
91 struct NonTrivialD
: NonTrivial
{
94 // CHECK-DAG: !DICompositeType({{.*}}, name: "NonTrivialE",{{.*}}flags: {{.*}}DIFlagNonTrivial
95 struct NonTrivialE
: Trivial
, NonTrivial
{