Debian Codegraph @

clang/test/DebugInfo/KeyInstructions/try-catch.cpp

raw
1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions %s -debug-info-kind=line-tables-only -emit-llvm -o - -fexceptions -fcxx-exceptions \
2 // RUN: | FileCheck %s
3
4 void except() {
5 // FIXME(OCH): Should `store i32 32, ptr %exception` be key?
6 throw 32;
7 }
8
9 void attempt() {
10 try { except(); }
11 // CHECK: catch:
12 // CHECK: %4 = call ptr @__cxa_begin_catch(ptr %exn)
13 // CHECK: %5 = load i32{{.*}}, !dbg [[G1R2:!.*]]
14 // CHECK: store i32 %5, ptr %e{{.*}}, !dbg [[G1R1:!.*]]
15 // CHECK: call void @__cxa_end_catch()
16 catch (int e) { }
17
18 // CHECK: ret{{.*}}, !dbg [[RET:!.*]]
19 }
20
21 // CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
22 // CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
23 // CHECK: [[RET]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)