annotate clang/test/CodeGenCXX/linetable-eh.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -gno-column-info -triple x86_64-apple-macosx10.9.0 -munwind-tables -std=c++11 -fcxx-exceptions -fexceptions %s -o - | FileCheck -allow-deprecated-dag-overlap %s
150
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // Test that emitting a landing pad does not affect the line table
anatofuz
parents:
diff changeset
4 // entries for the code that triggered it.
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 // CHECK: call void @llvm.dbg.declare
anatofuz
parents:
diff changeset
7 // CHECK: call void @llvm.dbg.declare(metadata {{.*}}, metadata ![[CURRENT_ADDR:.*]], metadata !{{.*}}), !dbg ![[DBG1:.*]]
anatofuz
parents:
diff changeset
8 // CHECK: unwind label %{{.*}}, !dbg ![[DBG1]]
anatofuz
parents:
diff changeset
9 // CHECK: store i64 %{{.*}}, i64* %current_address, align 8, !dbg ![[DBG4:.*]]
anatofuz
parents:
diff changeset
10 // CHECK-NEXT: call void @llvm.dbg.declare(metadata {{.*}}, metadata ![[FOUND_IT:.*]], metadata !{{.*}}), !dbg ![[DBG2:.*]]
anatofuz
parents:
diff changeset
11 // CHECK: = landingpad
anatofuz
parents:
diff changeset
12 // CHECK-NEXT: cleanup, !dbg ![[DBG3:.*]]
anatofuz
parents:
diff changeset
13 // CHECK-DAG: ![[CURRENT_ADDR]] = {{.*}}name: "current_address"
anatofuz
parents:
diff changeset
14 // CHECK-DAG: ![[FOUND_IT]] = {{.*}}name: "found_it"
anatofuz
parents:
diff changeset
15 // CHECK-DAG: ![[DBG1]] = !DILocation(line: 256,
anatofuz
parents:
diff changeset
16 // CHECK-DAG: ![[DBG2]] = !DILocation(line: 257,
anatofuz
parents:
diff changeset
17 // CHECK-DAG: ![[DBG3]] = !DILocation(line: 268,
anatofuz
parents:
diff changeset
18 // CHECK-DAG: ![[DBG4]] = !DILocation(line: 256,
anatofuz
parents:
diff changeset
19 typedef unsigned long long uint64_t;
anatofuz
parents:
diff changeset
20 template<class _Tp> class shared_ptr {
anatofuz
parents:
diff changeset
21 public:
anatofuz
parents:
diff changeset
22 typedef _Tp element_type;
anatofuz
parents:
diff changeset
23 element_type* __ptr_;
anatofuz
parents:
diff changeset
24 ~shared_ptr();
anatofuz
parents:
diff changeset
25 element_type* operator->() const noexcept {return __ptr_;}
anatofuz
parents:
diff changeset
26 };
anatofuz
parents:
diff changeset
27 class Context {
anatofuz
parents:
diff changeset
28 public:
anatofuz
parents:
diff changeset
29 uint64_t GetIt();
anatofuz
parents:
diff changeset
30 };
anatofuz
parents:
diff changeset
31 class Foo
anatofuz
parents:
diff changeset
32 {
anatofuz
parents:
diff changeset
33 bool bar();
anatofuz
parents:
diff changeset
34 virtual shared_ptr<Context> GetContext () = 0;
anatofuz
parents:
diff changeset
35 };
anatofuz
parents:
diff changeset
36 # 253 "Foo.cpp" 3
anatofuz
parents:
diff changeset
37 bool
anatofuz
parents:
diff changeset
38 Foo::bar ()
anatofuz
parents:
diff changeset
39 {
anatofuz
parents:
diff changeset
40 uint64_t current_address = GetContext()->GetIt();
anatofuz
parents:
diff changeset
41 bool found_it = false;
anatofuz
parents:
diff changeset
42 # 267 "Foo.cpp" 3
anatofuz
parents:
diff changeset
43 return found_it;
anatofuz
parents:
diff changeset
44 }