Debian Codegraph @

clang/test/DebugInfo/KeyInstructions/multi-func.c

raw
1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -gno-column-info -x c++ %s -debug-info-kind=line-tables-only -emit-llvm -o - \
2 // RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
3
4 // RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -gno-column-info -x c %s -debug-info-kind=line-tables-only -emit-llvm -o - \
5 // RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
6
7 // Check atomGroup is reset to start at 1 in each function.
8
9 int g;
10 // CHECK: store{{.*}}, !dbg [[AG:!.*]]
11 // CHECK: ret{{.*}}, !dbg [[ARET:!.*]]
12 void a() { g = 0; }
13
14 // CHECK: store{{.*}}, !dbg [[BG:!.*]]
15 // CHECK: ret{{.*}}, !dbg [[BRET:!.*]]
16 void b() { g = 0; }
17
18 // CHECK: [[A:!.*]] = distinct !DISubprogram(name: "a",
19 // CHECK: [[AG]] = !DILocation(line: 12, scope: [[A]], atomGroup: 1, atomRank: 1)
20 // CHECK: [[ARET]] = !DILocation(line: 12, scope: [[A]], atomGroup: 2, atomRank: 1)
21
22 // CHECK: [[B:!.*]] = distinct !DISubprogram(name: "b",
23 // CHECK: [[BG]] = !DILocation(line: 16, scope: [[B]], atomGroup: 1, atomRank: 1)
24 // CHECK: [[BRET]] = !DILocation(line: 16, scope: [[B]], atomGroup: 2, atomRank: 1)