summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX')
-rw-r--r--clang/test/CodeGenCXX/arm.cpp10
-rw-r--r--clang/test/CodeGenCXX/destructors.cpp10
-rw-r--r--clang/test/CodeGenCXX/dynamic-cast.cpp3
-rw-r--r--clang/test/CodeGenCXX/eh.cpp17
-rw-r--r--clang/test/CodeGenCXX/nrvo.cpp13
-rw-r--r--clang/test/CodeGenCXX/partial-destruction.cpp18
-rw-r--r--clang/test/CodeGenCXX/threadsafe-statics-exceptions.cpp7
-rw-r--r--clang/test/CodeGenCXX/typeid.cpp3
8 files changed, 49 insertions, 32 deletions
diff --git a/clang/test/CodeGenCXX/arm.cpp b/clang/test/CodeGenCXX/arm.cpp
index dcb27ce0dab..a767f425553 100644
--- a/clang/test/CodeGenCXX/arm.cpp
+++ b/clang/test/CodeGenCXX/arm.cpp
@@ -308,9 +308,10 @@ namespace test7 {
// CHECK: ret void
static int x = foo();
- // CHECK: call i8* @llvm.eh.exception()
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: cleanup
// CHECK: call void @__cxa_guard_abort(i32* @_ZGVZN5test74testEvE1x)
- // CHECK: call void @llvm.eh.resume(
+ // CHECK: resume { i8*, i32 }
}
}
@@ -347,9 +348,10 @@ namespace test8 {
// CHECK: ret void
static A x;
- // CHECK: call i8* @llvm.eh.exception()
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: cleanup
// CHECK: call void @__cxa_guard_abort(i32* @_ZGVZN5test84testEvE1x)
- // CHECK: call void @llvm.eh.resume(
+ // CHECK: resume { i8*, i32 }
}
}
diff --git a/clang/test/CodeGenCXX/destructors.cpp b/clang/test/CodeGenCXX/destructors.cpp
index dc24551a593..d9962e615ec 100644
--- a/clang/test/CodeGenCXX/destructors.cpp
+++ b/clang/test/CodeGenCXX/destructors.cpp
@@ -356,9 +356,10 @@ namespace test8 {
// CHECK: invoke void @_ZN5test312_GLOBAL__N_11DD1Ev(
// CHECK: call void @_ZdlPv({{.*}}) nounwind
// CHECK: ret void
- // CHECK: call i8* @llvm.eh.exception(
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: cleanup
// CHECK: call void @_ZdlPv({{.*}}) nounwind
- // CHECK: call void @llvm.eh.resume(
+ // CHECK: resume { i8*, i32 }
// Checked at top of file:
// @_ZN5test312_GLOBAL__N_11DD1Ev = alias internal {{.*}} @_ZN5test312_GLOBAL__N_11DD2Ev
@@ -386,9 +387,10 @@ namespace test8 {
// CHECK: invoke void @_ZN5test312_GLOBAL__N_11CD1Ev(
// CHECK: call void @_ZdlPv({{.*}}) nounwind
// CHECK: ret void
- // CHECK: call i8* @llvm.eh.exception()
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: cleanup
// CHECK: call void @_ZdlPv({{.*}}) nounwind
- // CHECK: call void @llvm.eh.resume(
+ // CHECK: resume { i8*, i32 }
// CHECK: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD1Ev(
// CHECK: getelementptr inbounds i8* {{.*}}, i64 -8
diff --git a/clang/test/CodeGenCXX/dynamic-cast.cpp b/clang/test/CodeGenCXX/dynamic-cast.cpp
index e84bb9b4ff5..813e36e941b 100644
--- a/clang/test/CodeGenCXX/dynamic-cast.cpp
+++ b/clang/test/CodeGenCXX/dynamic-cast.cpp
@@ -11,7 +11,8 @@ const B& f(A *a) {
// CHECK: invoke void @__cxa_bad_cast() noreturn
dynamic_cast<const B&>(*a);
} catch (...) {
- // CHECK: call i8* @llvm.eh.exception
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: catch i8* null
}
return fail;
}
diff --git a/clang/test/CodeGenCXX/eh.cpp b/clang/test/CodeGenCXX/eh.cpp
index 24807d92d70..e9909942479 100644
--- a/clang/test/CodeGenCXX/eh.cpp
+++ b/clang/test/CodeGenCXX/eh.cpp
@@ -115,9 +115,12 @@ namespace test7 {
throw 1;
}
-// CHECK: [[CAUGHTEXN:%.*]] = call i8* @llvm.eh.exception()
-// CHECK-NEXT: [[SELECTOR:%.*]] = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* [[CAUGHTEXN]], i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* bitcast (i8** @_ZTIi to i8*), i8* null)
+// CHECK: [[CAUGHTVAL:%.*]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+// CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
+// CHECK-NEXT: catch i8* null
+// CHECK-NEXT: [[CAUGHTEXN:%.*]] = extractvalue { i8*, i32 } [[CAUGHTVAL]], 0
// CHECK-NEXT: store i8* [[CAUGHTEXN]], i8** [[CAUGHTEXNVAR]]
+// CHECK-NEXT: [[SELECTOR:%.*]] = extractvalue { i8*, i32 } [[CAUGHTVAL]], 1
// CHECK-NEXT: store i32 [[SELECTOR]], i32* [[SELECTORVAR]]
// CHECK-NEXT: br label
// CHECK: [[SELECTOR:%.*]] = load i32* [[SELECTORVAR]]
@@ -134,9 +137,11 @@ namespace test7 {
throw;
}
}
-// CHECK: [[CAUGHTEXN:%.*]] = call i8* @llvm.eh.exception()
-// CHECK-NEXT: [[SELECTOR:%.*]] = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* [[CAUGHTEXN]], i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* null)
+// CHECK: [[CAUGHTVAL:%.*]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+// CHECK-NEXT: catch i8* null
+// CHECK-NEXT: [[CAUGHTEXN:%.*]] = extractvalue { i8*, i32 } [[CAUGHTVAL]], 0
// CHECK-NEXT: store i8* [[CAUGHTEXN]], i8** [[CAUGHTEXNVAR]]
+// CHECK-NEXT: [[SELECTOR:%.*]] = extractvalue { i8*, i32 } [[CAUGHTVAL]], 1
// CHECK-NEXT: store i32 [[SELECTOR]], i32* [[SELECTORVAR]]
// CHECK-NEXT: call void @__cxa_end_catch()
// CHECK-NEXT: br label
@@ -188,8 +193,8 @@ namespace test9 {
// CHECK: invoke void @_ZN5test96opaqueEv()
opaque();
} catch (int x) {
- // CHECK: call i8* @llvm.eh.exception
- // CHECK: call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* {{.*}}, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* bitcast (i8** @_ZTIi to i8*))
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
// CHECK: call i8* @__cxa_begin_catch
// CHECK: invoke void @_ZN5test96opaqueEv()
diff --git a/clang/test/CodeGenCXX/nrvo.cpp b/clang/test/CodeGenCXX/nrvo.cpp
index 0efb3553803..57bf27ab7af 100644
--- a/clang/test/CodeGenCXX/nrvo.cpp
+++ b/clang/test/CodeGenCXX/nrvo.cpp
@@ -68,8 +68,10 @@ X test2(bool B) {
// -> %cleanup, %lpad1
// %lpad: landing pad for ctor of 'y', dtor of 'y'
- // CHECK-EH: call i8* @llvm.eh.exception()
- // CHECK-EH: call i32 (i8*, i8*, ...)* @llvm.eh.selector
+ // CHECK-EH: [[CAUGHTVAL:%.*]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-EH-NEXT: cleanup
+ // CHECK-EH-NEXT: extractvalue { i8*, i32 } [[CAUGHTVAL]], 0
+ // CHECK-EH-NEXT: extractvalue { i8*, i32 } [[CAUGHTVAL]], 1
// CHECK-EH-NEXT: br label
// -> %eh.cleanup
@@ -95,12 +97,11 @@ X test2(bool B) {
// %invoke.cont17: rethrow block for %eh.cleanup.
// This really should be elsewhere in the function.
- // CHECK-EH: call void @llvm.eh.resume(
- // CHECK-EH-NEXT: unreachable
+ // CHECK-EH: resume { i8*, i32 }
// %terminate.lpad: terminate landing pad.
- // CHECK-EH: call i8* @llvm.eh.exception()
- // CHECK-EH-NEXT: call i32 (i8*, i8*, ...)* @llvm.eh.selector
+ // CHECK-EH: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-EH-NEXT: catch i8* null
// CHECK-EH-NEXT: call void @_ZSt9terminatev()
// CHECK-EH-NEXT: unreachable
diff --git a/clang/test/CodeGenCXX/partial-destruction.cpp b/clang/test/CodeGenCXX/partial-destruction.cpp
index b28c1384b8d..f232a159eda 100644
--- a/clang/test/CodeGenCXX/partial-destruction.cpp
+++ b/clang/test/CodeGenCXX/partial-destruction.cpp
@@ -50,7 +50,8 @@ namespace test0 {
// CHECK: ret void
// Partial destroy for initialization.
- // CHECK: llvm.eh.selector({{.*}}, i32 0)
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: cleanup
// CHECK: [[PARTIAL_END:%.*]] = load [[A]]** [[ENDVAR]]
// CHECK-NEXT: [[T0:%.*]] = icmp eq [[A]]* [[E_BEGIN]], [[PARTIAL_END]]
// CHECK-NEXT: br i1 [[T0]],
@@ -61,7 +62,8 @@ namespace test0 {
// CHECK-NEXT: br i1 [[T0]],
// Primary EH destructor.
- // CHECK: llvm.eh.selector({{.*}}, i32 0)
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: cleanup
// CHECK: [[E0:%.*]] = getelementptr inbounds [10 x [[A]]]* [[AS]], i32 0, i32 0
// CHECK-NEXT: [[E_END:%.*]] = getelementptr inbounds [[A]]* [[E0]], i64 10
// CHECK-NEXT: br label
@@ -70,7 +72,8 @@ namespace test0 {
// FIXME: There's some really bad block ordering here which causes
// the partial destroy for the primary normal destructor to fall
// within the primary EH destructor.
- // CHECK: llvm.eh.selector({{.*}}, i32 0)
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: cleanup
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[ED_BEGIN]], [[ED_CUR]]
// CHECK-NEXT: br i1 [[T0]]
// CHECK: [[EDD_AFTER:%.*]] = phi [[A]]* [ [[ED_CUR]], {{%.*}} ], [ [[EDD_CUR:%.*]], {{%.*}} ]
@@ -111,8 +114,10 @@ namespace test1 {
// CHECK-NEXT: ret void
// FIXME: again, the block ordering is pretty bad here
- // CHECK: eh.selector({{.*}}, i32 0)
- // CHECK: eh.selector({{.*}}, i32 0)
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: cleanup
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: cleanup
// CHECK: invoke void @_ZN5test11AD1Ev([[A]]* [[Y]])
// CHECK: invoke void @_ZN5test11AD1Ev([[A]]* [[X]])
}
@@ -139,7 +144,8 @@ namespace test2 {
// CHECK-NEXT: br i1 [[DONE]],
// Partial destruction landing pad.
- // CHECK: llvm.eh.exception()
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: cleanup
// CHECK: [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[CUR]]
// CHECK-NEXT: br i1 [[EMPTY]],
// CHECK: [[PAST:%.*]] = phi [[A]]* [ [[CUR]], {{%.*}} ], [ [[DEL:%.*]], {{%.*}} ]
diff --git a/clang/test/CodeGenCXX/threadsafe-statics-exceptions.cpp b/clang/test/CodeGenCXX/threadsafe-statics-exceptions.cpp
index aa79a4f6dd3..769d120be32 100644
--- a/clang/test/CodeGenCXX/threadsafe-statics-exceptions.cpp
+++ b/clang/test/CodeGenCXX/threadsafe-statics-exceptions.cpp
@@ -21,9 +21,8 @@ void f() {
throw Y();
// Finally, the landing pad.
- // CHECK: call i8* @llvm.eh.exception()
- // CHECK: call i32 (i8*, i8*, ...)* @llvm.eh.selector
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK: cleanup
// CHECK: call void @__cxa_guard_abort(i64* @_ZGVZ1fvE1x)
- // CHECK: call void @llvm.eh.resume(
- // CHECK: unreachable
+ // CHECK: resume { i8*, i32 }
}
diff --git a/clang/test/CodeGenCXX/typeid.cpp b/clang/test/CodeGenCXX/typeid.cpp
index 1af96705ba4..7ebf41c09f6 100644
--- a/clang/test/CodeGenCXX/typeid.cpp
+++ b/clang/test/CodeGenCXX/typeid.cpp
@@ -13,7 +13,8 @@ const char *f() {
// CHECK: invoke void @__cxa_bad_typeid() noreturn
return typeid(*static_cast<A *>(0)).name();
} catch (...) {
- // CHECK: call i8* @llvm.eh.exception
+ // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK-NEXT: catch i8* null
}
return 0;
OpenPOWER on IntegriCloud