fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
564 B15 linesraw
1# needs-sanitizer-support
2# only-x86_64
3# only-linux
4
5-include ../tools.mk
6
7# This test builds a staticlib, then an executable that links to it.
8# The staticlib and executable both  are compiled with address sanitizer,
9# and we assert that a fault in the staticlib is correctly detected.
10
11all:
12	$(RUSTC) -g -Z sanitizer=address --crate-type staticlib --target $(TARGET) library.rs
13	$(CC) program.c $(call STATICLIB,library) $(call OUT_EXE,program) $(EXTRACFLAGS) $(EXTRACXXFLAGS)
14	LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow
15