Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / debug-info-varargs.cpp
blob7afbcd255842ea4696bc2ef0eba2de017b3fe89d
1 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
3 struct A
5 void a(int c, ...) {}
6 };
8 // CHECK: !DISubprogram(name: "b", linkageName: "_Z1biz"
9 // CHECK-SAME: line: [[@LINE+2]]
10 // CHECK-SAME: type: ![[BTY:[0-9]+]]
11 void b(int c, ...) {
12 // CHECK: ![[BTY]] = !DISubroutineType(types: ![[BARGS:[0-9]+]])
13 // CHECK: ![[BARGS]] = !{null, !{{[0-9]+}}, null}
15 // The subprogram "a" comes after "b" because the function comes later.
16 // CHECK: !DISubprogram(name: "a", linkageName: "_ZN1A1aEiz"
17 // CHECK-SAME: line: 5,
18 // CHECK-SAME: type: ![[ATY:[0-9]+]]
19 // CHECK: ![[ATY]] = !DISubroutineType(types: ![[AARGS:[0-9]+]])
20 // We no longer use an explicit unspecified parameter. Instead we use a trailing null to mean the function is variadic.
21 // CHECK: ![[AARGS]] = !{null, !{{[0-9]+}}, !{{[0-9]+}}, null}
23 A a;
25 // CHECK: !DILocalVariable(name: "fptr"
26 // CHECK-SAME: line: [[@LINE+2]]
27 // CHECK-SAME: type: ![[PST:[0-9]+]]
28 void (*fptr)(int, ...) = b;
29 // CHECK: ![[PST]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[BTY]],