annotate clang/test/CodeGenCXX/noexcept.cpp @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions -std=c++11 | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // rdar://11904428
anatofuz
parents:
diff changeset
4 // Ensure that we call __cxa_begin_catch before calling
anatofuz
parents:
diff changeset
5 // std::terminate in a noexcept function.
anatofuz
parents:
diff changeset
6 namespace test0 {
anatofuz
parents:
diff changeset
7 void foo();
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 struct A {
anatofuz
parents:
diff changeset
10 A();
anatofuz
parents:
diff changeset
11 ~A();
anatofuz
parents:
diff changeset
12 };
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 void test() noexcept {
anatofuz
parents:
diff changeset
15 A a;
anatofuz
parents:
diff changeset
16 foo();
anatofuz
parents:
diff changeset
17 }
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19 // CHECK-LABEL: define void @_ZN5test04testEv()
anatofuz
parents:
diff changeset
20 // CHECK: [[EXN:%.*]] = alloca i8*
anatofuz
parents:
diff changeset
21 // This goes to the terminate lpad.
anatofuz
parents:
diff changeset
22 // CHECK: invoke void @_ZN5test01AC1Ev(
anatofuz
parents:
diff changeset
23 // This goes to the cleanup-and-then-terminate lpad.
anatofuz
parents:
diff changeset
24 // CHECK: invoke void @_ZN5test03fooEv()
anatofuz
parents:
diff changeset
25 // Destructors don't throw by default in C++11.
anatofuz
parents:
diff changeset
26 // CHECK: call void @_ZN5test01AD1Ev(
anatofuz
parents:
diff changeset
27 // Cleanup lpad.
anatofuz
parents:
diff changeset
28 // CHECK: [[T0:%.*]] = landingpad
anatofuz
parents:
diff changeset
29 // CHECK-NEXT: catch i8* null
anatofuz
parents:
diff changeset
30 // CHECK-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0
anatofuz
parents:
diff changeset
31 // CHECK-NEXT: store i8* [[T1]], i8** [[EXN]]
anatofuz
parents:
diff changeset
32 // (Calling this destructor is not technically required.)
anatofuz
parents:
diff changeset
33 // CHECK: call void @_ZN5test01AD1Ev(
anatofuz
parents:
diff changeset
34 // CHECK-NEXT: br label
anatofuz
parents:
diff changeset
35 // The terminate landing pad jumps in here for some reason.
anatofuz
parents:
diff changeset
36 // CHECK: [[T0:%.*]] = landingpad
anatofuz
parents:
diff changeset
37 // CHECK-NEXT: catch i8* null
anatofuz
parents:
diff changeset
38 // CHECK-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0
anatofuz
parents:
diff changeset
39 // CHECK-NEXT: call void @__clang_call_terminate(i8* [[T1]])
anatofuz
parents:
diff changeset
40 // CHECK-NEXT: unreachable
anatofuz
parents:
diff changeset
41 // The terminate handler chained to by the cleanup lpad.
anatofuz
parents:
diff changeset
42 // CHECK: [[T0:%.*]] = load i8*, i8** [[EXN]]
anatofuz
parents:
diff changeset
43 // CHECK-NEXT: call void @__clang_call_terminate(i8* [[T0]])
anatofuz
parents:
diff changeset
44 // CHECK-NEXT: unreachable
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 // CHECK-LABEL: define linkonce_odr hidden void @__clang_call_terminate(
anatofuz
parents:
diff changeset
47 // CHECK: call i8* @__cxa_begin_catch(
anatofuz
parents:
diff changeset
48 // CHECK-NEXT: call void @_ZSt9terminatev()
anatofuz
parents:
diff changeset
49 // CHECK-NEXT: unreachable