Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/Cargo.lock
/target/
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2018"

[workspace]
19 changes: 19 additions & 0 deletions src/test/run-make-fulldeps/sanitizer-memory-build-core/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# needs-sanitizer-support
# needs-sanitizer-memory

# This test builds a trivial program with memory sanitizer
# and rebuilds part of the standard library

# -Clink-dead-code is a setting that sanitizer front-ends generally enable,
# due to issues with certain linkers mangling sections used to track
# coverage when trying to remove dead code
# Linking dead code allows tracking more regressions generating code for the
# standard library, eg for target features that are not currently enabled.

# -Ccodegen-units=1 is also enabled by the front-ends, to work around
# misoptimisations with ThinLTO.

all:
RUSTFLAGS="-Cpasses=sancov -Clink-dead-code -Zsanitizer=memory -Ccodegen-units=1" \
cargo build --verbose --release -Zbuild-std=core --target $(TARGET)

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}