summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-02-26 22:55:46 +0000
committerVedant Kumar <vsk@apple.com>2019-02-26 22:55:46 +0000
commit73522d167890e904e6a42eb06836dd1ecc2fb8fc (patch)
treef2fab828c7348c631ad57b06f27fbc20bb33df0a /llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
parent35d2d51369b4ddc03893c10082a47cab4a2185e5 (diff)
downloadbcm5719-llvm-73522d167890e904e6a42eb06836dd1ecc2fb8fc.tar.gz
bcm5719-llvm-73522d167890e904e6a42eb06836dd1ecc2fb8fc.zip
[HotColdSplit] Disable splitting for sanitized functions
Splitting can make sanitizer errors harder to understand, as the trapping instruction may not be in the function where the bug was detected. rdar://48142697 llvm-svn: 354931
Diffstat (limited to 'llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll')
-rw-r--r--llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll72
1 files changed, 72 insertions, 0 deletions
diff --git a/llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll b/llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
index 448e63ab1de..076174d0a05 100644
--- a/llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
+++ b/llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
@@ -110,6 +110,78 @@ if.end: ; preds = %entry
ret void
}
+; CHECK-LABEL: @sanitize_address
+; CHECK-NOT: sanitize_address.cold.1
+define void @sanitize_address() sanitize_address {
+entry:
+ br i1 undef, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ call void @sink()
+ ret void
+
+if.end: ; preds = %entry
+ ret void
+}
+
+; CHECK-LABEL: @sanitize_hwaddress
+; CHECK-NOT: sanitize_hwaddress.cold.1
+define void @sanitize_hwaddress() sanitize_hwaddress {
+entry:
+ br i1 undef, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ call void @sink()
+ ret void
+
+if.end: ; preds = %entry
+ ret void
+}
+
+; CHECK-LABEL: @sanitize_thread
+; CHECK-NOT: sanitize_thread.cold.1
+define void @sanitize_thread() sanitize_thread {
+entry:
+ br i1 undef, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ call void @sink()
+ ret void
+
+if.end: ; preds = %entry
+ ret void
+}
+
+; CHECK-LABEL: @sanitize_memory
+; CHECK-NOT: sanitize_memory.cold.1
+define void @sanitize_memory() sanitize_memory {
+entry:
+ br i1 undef, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ call void @sink()
+ ret void
+
+if.end: ; preds = %entry
+ ret void
+}
+
+declare void @llvm.trap() cold noreturn
+
+; CHECK-LABEL: @nosanitize_call
+; CHECK-NOT: nosanitize_call.cold.1
+define void @nosanitize_call() sanitize_memory {
+entry:
+ br i1 undef, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ call void @llvm.trap(), !nosanitize !2
+ unreachable
+
+if.end: ; preds = %entry
+ ret void
+}
+
declare void @llvm.dbg.value(metadata, metadata, metadata)
declare void @sink() cold
OpenPOWER on IntegriCloud