xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/inlined_variables_with_zero_cov.test (revision 6ba150dbb44346f4f2b39d15b85f3c2339427771)
1## This checks the number of inlined variables with 0% location
2## coverage in split dwarf cases.
3##  $ cat test1.cpp
4##  __attribute__((optnone)) static void x() {
5##  }
6##  __attribute__((always_inline)) static void y() {
7##    int var;
8##    x();
9##  }
10##  void f1() {
11##    y();
12##  }
13##
14##  $ cat test2.cpp
15##  __attribute__((optnone)) static void x() {
16##  }
17##  __attribute__((always_inline)) static void y() {
18##    int var;
19##    x();
20##  }
21##  void f1();
22##  int main() {
23##    f1();
24##    y();
25##  }
26##  $ clang++ -O1 -g -gsplit-dwarf test2.cpp test1.cpp -S
27##  The split-dwarf.s was handcrafted.
28
29REQUIRES: x86_64-linux
30RUN: rm -rf %t
31RUN: mkdir %t
32RUN: cd %t
33RUN: llvm-mc -triple x86_64-unknown-linux -filetype=obj %S/Inputs/split-dwarf-objfile1.s -o test1.dwo
34RUN: llvm-mc -triple x86_64-unknown-linux -filetype=obj %S/Inputs/split-dwarf-objfile2.s -o test2.dwo
35RUN: llvm-mc -triple x86_64-unknown-linux -filetype=obj %S/Inputs/split-dwarf.s -o split-dwarf.o
36RUN: llvm-dwarfdump --statistics split-dwarf.o | FileCheck %s
37
38CHECK: "#variables processed by location statistics": 2
39CHECK: "#variables with 0% of parent scope covered by DW_AT_location": 2
40CHECK: "#local vars processed by location statistics": 2
41CHECK: "#local vars with 0% of parent scope covered by DW_AT_location": 2
42