xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/destructor-debug-info.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: %clang_cc1 -g -S -emit-llvm %s -o - | FileCheck %s
2f4a2713aSLionel Sambuc 
3f4a2713aSLionel Sambuc class A { int a; };
4f4a2713aSLionel Sambuc class B {
5f4a2713aSLionel Sambuc public:
B()6f4a2713aSLionel Sambuc   B() { a = new A; }
~B()7f4a2713aSLionel Sambuc   ~B() { delete a; }
8f4a2713aSLionel Sambuc private:
9f4a2713aSLionel Sambuc   A *a;
10f4a2713aSLionel Sambuc };
11f4a2713aSLionel Sambuc 
12f4a2713aSLionel Sambuc void fn(B b);
13f4a2713aSLionel Sambuc 
14f4a2713aSLionel Sambuc int i;
foo()15f4a2713aSLionel Sambuc void foo() {
16f4a2713aSLionel Sambuc   if (i) {
17f4a2713aSLionel Sambuc     B b1;
18f4a2713aSLionel Sambuc     fn (b1);
19f4a2713aSLionel Sambuc   }
20f4a2713aSLionel Sambuc }
21f4a2713aSLionel Sambuc // Check there is a line number entry for line 19 where b1 is destructed.
22*0a6a1f1dSLionel Sambuc // CHECK: !MDLocation(line: 19,
23