Clang Project

clang_source_code/test/CodeGen/debug-label.c
1// This test will test the correstness of generating DILabel and
2// llvm.dbg.label for labels.
3//
4// RUN: %clang_cc1 -emit-llvm %s -o - -emit-llvm -debug-info-kind=limited | FileCheck %s
5
6int f1(int a, int b) {
7  int sum;
8
9top:
10  // CHECK: call void @llvm.dbg.label(metadata [[LABEL_METADATA:!.*]]), !dbg [[LABEL_LOCATION:!.*]]
11  sum = a + b;
12  return sum;
13}
14
15// CHECK: [[LABEL_METADATA]] = !DILabel({{.*}}, name: "top", {{.*}}, line: 9)
16// CHECK: [[LABEL_LOCATION]] = !DILocation(line: 9,
17