Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / debug-label-inline.c
blobc0b089aad8eb9970bb7f194488bb9b2ef3689e0c
1 // This test will test the correctness of generating DILabel and
2 // llvm.dbg.label when the label is in inlined functions.
3 //
4 // RUN: %clang_cc1 -O2 %s -o - -emit-llvm -debug-info-kind=limited | FileCheck %s
5 inline int f1(int a, int b) {
6 int sum;
8 top:
9 sum = a + b;
10 return sum;
13 extern int ga, gb;
15 int f2(void) {
16 int result;
18 result = f1(ga, gb);
19 // CHECK: call void @llvm.dbg.label(metadata [[LABEL_METADATA:!.*]]), !dbg [[LABEL_LOCATION:!.*]]
21 return result;
24 // CHECK: distinct !DISubprogram(name: "f1", {{.*}}, retainedNodes: [[ELEMENTS:!.*]])
25 // CHECK: [[ELEMENTS]] = !{{{.*}}, [[LABEL_METADATA]]}
26 // CHECK: [[LABEL_METADATA]] = !DILabel({{.*}}, name: "top", {{.*}}, line: 8)
27 // CHECK: [[INLINEDAT:!.*]] = distinct !DILocation(line: 18,
28 // CHECK: [[LABEL_LOCATION]] = !DILocation(line: 8, {{.*}}, inlinedAt: [[INLINEDAT]])