summaryrefslogtreecommitdiffstats
path: root/llvm/test/Instrumentation/DataFlowSanitizer/uninstrumented_local_functions.ll
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2018-03-30 18:37:55 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2018-03-30 18:37:55 +0000
commitd03bf12c1bc13f7e75be90d04eeaa38128c9d5e0 (patch)
treee4876b4fd24b1302854fed28e79b4c0009b5c659 /llvm/test/Instrumentation/DataFlowSanitizer/uninstrumented_local_functions.ll
parent5e3ee945623c1eff6477ae204b1376a4bd55e793 (diff)
downloadbcm5719-llvm-d03bf12c1bc13f7e75be90d04eeaa38128c9d5e0.tar.gz
bcm5719-llvm-d03bf12c1bc13f7e75be90d04eeaa38128c9d5e0.zip
DataFlowSanitizer: wrappers of functions with local linkage should have the same linkage as the function being wrapped
This patch resolves link errors when the address of a static function is taken, and that function is uninstrumented by DFSan. This change resolves bug 36314. Patch by Sam Kerner! Differential Revision: https://reviews.llvm.org/D44784 llvm-svn: 328890
Diffstat (limited to 'llvm/test/Instrumentation/DataFlowSanitizer/uninstrumented_local_functions.ll')
-rw-r--r--llvm/test/Instrumentation/DataFlowSanitizer/uninstrumented_local_functions.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/uninstrumented_local_functions.ll b/llvm/test/Instrumentation/DataFlowSanitizer/uninstrumented_local_functions.ll
new file mode 100644
index 00000000000..12579ce0fde
--- /dev/null
+++ b/llvm/test/Instrumentation/DataFlowSanitizer/uninstrumented_local_functions.ll
@@ -0,0 +1,24 @@
+; RUN: opt < %s -dfsan -dfsan-args-abi -dfsan-abilist=%S/Inputs/abilist.txt -S | FileCheck %s
+; RUN: opt < %s -dfsan -dfsan-abilist=%S/Inputs/abilist.txt -S | FileCheck %s
+
+target triple = "x86_64-unknown-linux-gnu"
+
+define internal i8 @uninstrumented_internal_fun(i8 %in) {
+ ret i8 %in
+}
+
+define i8 @call_uninstrumented_internal_fun(i8 %in) {
+ %call = call i8 @uninstrumented_internal_fun(i8 %in)
+ ret i8 %call
+}
+; CHECK: define internal {{(i8|{ i8, i16 })}} @"dfsw$uninstrumented_internal_fun"
+
+define private i8 @uninstrumented_private_fun(i8 %in) {
+ ret i8 %in
+}
+
+define i8 @call_uninstrumented_private_fun(i8 %in) {
+ %call = call i8 @uninstrumented_private_fun(i8 %in)
+ ret i8 %call
+}
+; CHECK: define private {{(i8|{ i8, i16 })}} @"dfsw$uninstrumented_private_fun"
OpenPOWER on IntegriCloud