File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s -O1 -fexceptions -fcxx-exceptions | FileCheck %s
2+
3+ struct Trivial {
4+ int x[100 ];
5+ };
6+
7+ void func_that_throws (Trivial t);
8+
9+ // CHECK-LABEL: define dso_local void @_Z4testv(){{.*}} personality ptr @__gxx_personality_v0
10+ void test () {
11+ // CHECK: %[[AGG1:.*]] = alloca %struct.Trivial, align
12+ // CHECK: %[[AGG2:.*]] = alloca %struct.Trivial, align
13+
14+ // CHECK: call void @llvm.lifetime.start.p0(ptr nonnull %[[AGG1]])
15+ // CHECK: invoke void @_Z16func_that_throws7Trivial(ptr noundef nonnull byval(%struct.Trivial) align 8 %[[AGG1]])
16+ // CHECK-NEXT: to label %[[CONT1:.*]] unwind label %[[LPAD1:.*]]
17+
18+ // CHECK: [[CONT1]]:
19+ // CHECK-NEXT: call void @llvm.lifetime.start.p0(ptr nonnull %[[AGG2]])
20+ // CHECK: invoke void @_Z16func_that_throws7Trivial(ptr noundef nonnull byval(%struct.Trivial) align 8 %[[AGG2]])
21+ // CHECK-NEXT: to label %[[CONT2:.*]] unwind label %[[LPAD2:.*]]
22+
23+ // CHECK: [[CONT2]]:
24+ // CHECK-DAG: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG2]])
25+ // CHECK-DAG: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG1]])
26+ // CHECK: br label %[[TRY_CONT:.*]]
27+
28+ // CHECK: [[LPAD1]]:
29+ // CHECK: landingpad
30+ // CHECK: br label %[[EHCLEANUP:.*]]
31+
32+ // CHECK: [[LPAD2]]:
33+ // CHECK: landingpad
34+ // CHECK: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG2]])
35+ // CHECK: br label %[[EHCLEANUP]]
36+
37+ // CHECK: [[EHCLEANUP]]:
38+ // CHECK: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG1]])
39+ // CHECK: call ptr @__cxa_begin_catch
40+ try {
41+ func_that_throws (Trivial{0 });
42+ func_that_throws (Trivial{0 });
43+ } catch (...) {
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments