blob: 1f117f2afa5e5a7922eb48e49176dd4965aa93ea [file] [log] [blame]
Adrian Prantl52bf3c42013-05-03 20:11:48 +00001// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
2
Adrian Prantl6815d6c2013-07-24 20:44:20 +00003// Check the line numbers for cleanup code with EH in combination with
Adrian Prantl52bf3c42013-05-03 20:11:48 +00004// simple return expressions.
5
6// CHECK: define {{.*}}foo
7// CHECK: call void @_ZN1CD1Ev(%class.C* {{.*}}), !dbg ![[CLEANUP:[0-9]+]]
8// CHECK: ret i32 0, !dbg ![[RET:[0-9]+]]
9
10class C {
11public:
12 ~C() {}
13 int i;
14};
15
16int foo()
17{
18 C c;
19 c.i = 42;
20 // This breakpoint should be at/before the cleanup code.
21 // CHECK: ![[CLEANUP]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
22 return 0;
23 // CHECK: ![[RET]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
24}