fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
627 B16 linesraw
1# needs-sanitizer-support
2# needs-sanitizer-address
3
4include ../tools.mk
5
6LOG := $(TMPDIR)/log.txt
7
8# This test builds a shared object, then an executable that links it as a native
9# rust library (contrast to an rlib). The shared library and executable both
10# are compiled with address sanitizer, and we assert that a fault in the cdylib
11# is correctly detected.
12
13all:
14	$(RUSTC) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET) library.rs
15	$(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) -llibrary program.rs
16	LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow