From dee4e02102197adc29be9bf98083297dd3f5e2ed Mon Sep 17 00:00:00 2001 From: Ramon de C Valle Date: Thu, 1 Feb 2024 13:16:30 -0800 Subject: 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`). --- tests/codegen/sanitizer/dataflow-instrument-functions.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/codegen/sanitizer/dataflow-instrument-functions.rs (limited to 'tests/codegen') 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 -- cgit 1.4.1-3-g733a5