blob: db01c81db6d6af2cadf48a1f90a017a107dc24ce [file] [log] [blame]
David Majnemerdc012fa2015-04-22 21:38:15 +00001// RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -gline-tables-only %s -o - | FileCheck %s
2
3// Inserting lifetime markers should not affect debuginfo: lifetime.end is not
4// a destructor, but instrumentation for the compiler. Ensure the debug info for
5// the return statement (in the IR) does not point to the function closing '}'
6// which is used to show some destructors have been called before leaving the
7// function.
8
9extern int f(int);
10extern int g(int);
11
12// CHECK-LABEL: define i32 @test
13int test(int a, int b) {
14 int res;
15
16 if (a==2) {
17 int r = f(b);
18 res = r + b;
19 a += 2;
20 } else {
21 int r = f(a);
22 res = r + a;
23 b += 1;
24 }
25
26 return res;
27// CHECK: ret i32 %{{.*}}, !dbg [[DI:![0-9]+]]
28// CHECK: [[DI]] = !MDLocation(line: [[@LINE-2]]
29}