Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / debug-info-cxx1y.cpp
blob42c801ad6530c32b64cfc7aa04d25930553cfc2f
1 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm-only -std=c++14 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
3 // CHECK: imports: [[IMPS:![0-9]*]]
5 // CHECK: [[IMPS]] = !{[[IMP:![0-9]*]]}
6 // CHECK: [[IMP]] = !DIImportedEntity(
7 // CHECK-SAME: entity: [[F3:![0-9]*]]
8 // CHECK: [[F3]] = distinct !DISubprogram(name: "f3"
9 // CHECK-SAME: type: [[SUBROUTINE_TYPE:![0-9]*]]
10 // CHECK: [[SUBROUTINE_TYPE]] = !DISubroutineType(types: [[TYPE_LIST:![0-9]*]])
11 // CHECK: [[TYPE_LIST]] = !{[[INT:![0-9]*]]}
12 // CHECK: [[INT]] = !DIBasicType(name: "int"
14 // CHECK: [[FOO:![0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo",
15 // CHECK-SAME: elements: [[EMPTY:![0-9]*]]
16 // CHECK: [[EMPTY]] = !{}
18 // FIXME: The context of this definition should be the CU/file scope, not the class.
19 // CHECK: !DISubprogram(name: "func", {{.*}} scope: [[FOO]]
20 // CHECK-SAME: type: [[SUBROUTINE_TYPE]]
21 // CHECK-SAME: DISPFlagDefinition
22 // CHECK-SAME: declaration: [[FUNC_DECL:![0-9]*]]
23 // CHECK: [[FUNC_DECL]] = !DISubprogram(name: "func",
24 // CHECK-SAME: scope: [[FOO]]
25 // CHECK-SAME: type: [[SUBROUTINE_TYPE]]
26 // CHECK-SAME: spFlags: 0
28 struct foo {
29 static auto func();
32 foo f;
34 auto foo::func() {
35 return 1;
38 namespace ns {
39 auto f2();
40 auto f3() {
41 return 0;
44 using ns::f2;
45 using ns::f3;