about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorRamon de C Valle <rcvalle@users.noreply.github.com>2024-02-01 13:16:30 -0800
committerRamon de C Valle <rcvalle@users.noreply.github.com>2024-03-01 18:50:40 -0800
commitdee4e02102197adc29be9bf98083297dd3f5e2ed (patch)
tree510d1bc6652086782ea25e69a0a0b2a985f623aa /tests/codegen
parenteaee1e9453bfb4e1fb3753aa37450bb47cd7629d (diff)
downloadrust-dee4e02102197adc29be9bf98083297dd3f5e2ed.tar.gz
rust-dee4e02102197adc29be9bf98083297dd3f5e2ed.zip
Add initial support for DataFlowSanitizer
Adds initial support for DataFlowSanitizer to the Rust compiler. It
currently supports `-Zsanitizer-dataflow-abilist`. Additional options
for it can be passed to LLVM command line argument processor via LLVM
arguments using `llvm-args` codegen option (e.g.,
`-Cllvm-args=-dfsan-combine-pointer-labels-on-load=false`).
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/sanitizer/dataflow-instrument-functions.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/codegen/sanitizer/dataflow-instrument-functions.rs b/tests/codegen/sanitizer/dataflow-instrument-functions.rs
new file mode 100644
index 00000000000..69c3560882c
--- /dev/null
+++ b/tests/codegen/sanitizer/dataflow-instrument-functions.rs
@@ -0,0 +1,10 @@
+// Verifies that functions are instrumented.
+//
+//@ needs-sanitizer-dataflow
+//@ compile-flags: -Copt-level=0 -Zsanitizer=dataflow
+
+#![crate_type="lib"]
+
+pub fn foo() {
+}
+// CHECK: define{{.*}}foo{{.*}}.dfsan