summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/HotColdSplit/resume.ll12
-rw-r--r--llvm/test/Transforms/HotColdSplit/unwind.ll12
2 files changed, 18 insertions, 6 deletions
diff --git a/llvm/test/Transforms/HotColdSplit/resume.ll b/llvm/test/Transforms/HotColdSplit/resume.ll
index 2b8ea7d91d9..67d2d241916 100644
--- a/llvm/test/Transforms/HotColdSplit/resume.ll
+++ b/llvm/test/Transforms/HotColdSplit/resume.ll
@@ -6,11 +6,17 @@ target triple = "x86_64-apple-macosx10.14.0"
; Consider `resume` to be cold.
; CHECK-LABEL: define {{.*}}@foo.cold.1(
-; CHECK: resume i32 undef
+; CHECK: call {{.*}}@sink(
-define i32 @foo(i32 %cond) personality i8 0 {
+declare void @sink() cold
+
+define i32 @foo() personality i8 0 {
entry:
- br i1 undef, label %resume-eh, label %normal
+ br i1 undef, label %pre-resume-eh, label %normal
+
+pre-resume-eh:
+ call void @sink()
+ br label %resume-eh
resume-eh:
resume i32 undef
diff --git a/llvm/test/Transforms/HotColdSplit/unwind.ll b/llvm/test/Transforms/HotColdSplit/unwind.ll
index adcae98d9bb..66e2f76e327 100644
--- a/llvm/test/Transforms/HotColdSplit/unwind.ll
+++ b/llvm/test/Transforms/HotColdSplit/unwind.ll
@@ -3,12 +3,15 @@
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.14.0"
-; Do not mark outlined functions which resume exception unwinding as noreturn.
+; Do not split out `resume` instructions.
; CHECK-LABEL: define {{.*}}@foo.cold.1(
-; CHECK: resume
+; CHECK: call {{.*}}@sink(
+; CHECK-NOT: resume i32 undef
+
; CHECK-NOT: noreturn
-define i32 @foo(i32 %cond) personality i8 0 {
+
+define i32 @foo() personality i8 0 {
entry:
invoke void @llvm.donothing() to label %normal unwind label %exception
@@ -19,6 +22,9 @@ exception:
continue_exception:
call void @sideeffect(i32 0)
call void @sink()
+ br label %resume-eh
+
+resume-eh:
resume i32 undef
normal:
OpenPOWER on IntegriCloud