File tree Expand file tree Collapse file tree 11 files changed +20
-30
lines changed
src/test/run-make-fulldeps
sanitizer-invalid-cratetype Expand file tree Collapse file tree 11 files changed +20
-30
lines changed Original file line number Diff line number Diff line change 1+ # needs-profiler-support
2+
13-include ../tools.mk
24
35all :
4- ifeq ($(RUSTC_PROFILER_SUPPORT ) ,1)
56 $(RUSTC ) -Copt-level=3 -Clto=fat -Z pgo-gen=" $( TMPDIR) " test.rs
67 $(call RUN,test) || exit 1
78 [ -e " $( TMPDIR) " /default_* .profraw ] || (echo " No .profraw file" ; exit 1)
8- endif
Original file line number Diff line number Diff line change 1+ # needs-profiler-support
2+
13-include ../tools.mk
24
35all :
4- ifeq ($(RUSTC_PROFILER_SUPPORT ) ,1)
56 $(RUSTC ) -O -Ccodegen-units=1 -Z pgo-gen=" $( TMPDIR) " --emit=llvm-ir test.rs
67 # We expect symbols starting with "__llvm_profile_".
78 $(CGREP ) " __llvm_profile_" < $(TMPDIR ) /test.ll
89 # We do NOT expect the "__imp_" version of these symbols.
910 $(CGREP ) -v " __imp___llvm_profile_" < $(TMPDIR ) /test.ll # 64 bit
1011 $(CGREP ) -v " __imp____llvm_profile_" < $(TMPDIR ) /test.ll # 32 bit
11- endif
Original file line number Diff line number Diff line change 1+ # needs-profiler-support
2+
13-include ../tools.mk
24
35all :
4- ifeq ($(RUSTC_PROFILER_SUPPORT ) ,1)
56 $(RUSTC ) -g -Z pgo-gen=" $( TMPDIR) " test.rs
67 $(call RUN,test) || exit 1
78 [ -e " $( TMPDIR) " /default_* .profraw ] || (echo " No .profraw file" ; exit 1)
8- endif
Original file line number Diff line number Diff line change 1+ # needs-profiler-support
2+
13-include ../tools.mk
24
35all :
4- ifeq ($(RUSTC_PROFILER_SUPPORT ) ,1)
56 $(RUSTC ) -g -Z profile test.rs
67 $(call RUN,test) || exit 1
78 [ -e " $( TMPDIR) /test.gcno" ] || (echo " No .gcno file" ; exit 1)
89 [ -e " $( TMPDIR) /test.gcda" ] || (echo " No .gcda file" ; exit 1)
9- endif
Original file line number Diff line number Diff line change 1+ # needs-sanitizer-support
2+
13-include ../tools.mk
24
35LOG := $(TMPDIR ) /log.txt
46
57# NOTE the address sanitizer only supports x86_64 linux and macOS
68
79ifeq ($(TARGET ) ,x86_64-apple-darwin)
8- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
910EXTRA_RUSTFLAG =-C rpath
1011else
1112ifeq ($(TARGET ) ,x86_64-unknown-linux-gnu)
12- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
1313
1414# Apparently there are very specific Linux kernels, notably the one that's
1515# currently on Travis CI, which contain a buggy commit that triggers failures in
2323endif
2424
2525all :
26- ifeq ($(ASAN_SUPPORT ) ,1)
2726 $(RUSTC ) -g -Z sanitizer=address -Z print-link-args $(EXTRA_RUSTFLAG ) overflow.rs | $(CGREP ) librustc_asan
2827 $(TMPDIR ) /overflow 2>&1 | $(CGREP ) stack-buffer-overflow
29- endif
Original file line number Diff line number Diff line change 1+ # needs-sanitizer-support
2+
13-include ../tools.mk
24
35LOG := $(TMPDIR ) /log.txt
@@ -8,15 +10,12 @@ LOG := $(TMPDIR)/log.txt
810# is correctly detected.
911
1012ifeq ($(TARGET ) ,x86_64-unknown-linux-gnu)
11- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
1213
1314# See comment in sanitizer-address/Makefile for why this is here
1415EXTRA_RUSTFLAG =-C relocation-model=dynamic-no-pic
1516endif
1617
1718all :
18- ifeq ($(ASAN_SUPPORT ) ,1)
1919 $(RUSTC ) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET ) $(EXTRA_RUSTFLAG ) library.rs
2020 $(RUSTC ) -g -Z sanitizer=address --crate-type bin --target $(TARGET ) $(EXTRA_RUSTFLAG ) -llibrary program.rs
2121 LD_LIBRARY_PATH=$(TMPDIR ) $(TMPDIR ) /program 2>&1 | $(CGREP ) stack-buffer-overflow
22- endif
Original file line number Diff line number Diff line change 1+ # needs-sanitizer-support
2+
13-include ../tools.mk
24
35LOG := $(TMPDIR ) /log.txt
@@ -8,15 +10,11 @@ LOG := $(TMPDIR)/log.txt
810# is correctly detected.
911
1012ifeq ($(TARGET ) ,x86_64-unknown-linux-gnu)
11- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
12-
1313# See comment in sanitizer-address/Makefile for why this is here
1414EXTRA_RUSTFLAG =-C relocation-model=dynamic-no-pic
1515endif
1616
1717all :
18- ifeq ($(ASAN_SUPPORT ) ,1)
1918 $(RUSTC ) -g -Z sanitizer=address --crate-type dylib --target $(TARGET ) $(EXTRA_RUSTFLAG ) library.rs
2019 $(RUSTC ) -g -Z sanitizer=address --crate-type bin --target $(TARGET ) $(EXTRA_RUSTFLAG ) -llibrary program.rs
2120 LD_LIBRARY_PATH=$(TMPDIR ) $(TMPDIR ) /program 2>&1 | $(CGREP ) stack-buffer-overflow
22- endif
Original file line number Diff line number Diff line change 1+ # needs-sanitizer-support
2+
13-include ../tools.mk
24
35# NOTE the address sanitizer only supports x86_64 linux and macOS
46
57ifeq ($(TARGET ) ,x86_64-apple-darwin)
6- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
78EXTRA_RUSTFLAG =-C rpath
89else
910ifeq ($(TARGET ) ,x86_64-unknown-linux-gnu)
10- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
1111EXTRA_RUSTFLAG =
1212endif
1313endif
1414
1515all :
16- ifeq ($(ASAN_SUPPORT ) ,1)
1716 $(RUSTC ) -Z sanitizer=address --crate-type proc-macro --target $(TARGET ) hello.rs 2>&1 | $(CGREP ) ' -Z sanitizer'
18- endif
Original file line number Diff line number Diff line change 11-include ../tools.mk
22
3+ # needs-sanitizer-support
34# only-linux
45# only-x86_64
56# ignore-test
67# FIXME(#46126) ThinLTO for libstd broke this test
78
89all :
9- ifdef RUSTC_SANITIZER_SUPPORT
1010 $(RUSTC ) -C opt-level=1 -g -Z sanitizer=leak -Z print-link-args leak.rs | $(CGREP ) librustc_lsan
1111 $(TMPDIR ) /leak 2>&1 | $(CGREP ) ' detected memory leaks'
12- endif
Original file line number Diff line number Diff line change 11-include ../tools.mk
22
3+ # needs-sanitizer-support
34# only-linux
45# only-x86_64
56
67all :
7- ifdef RUSTC_SANITIZER_SUPPORT
88 $(RUSTC ) -g -Z sanitizer=memory -Z print-link-args uninit.rs | $(CGREP ) librustc_msan
99 $(TMPDIR ) /uninit 2>&1 | $(CGREP ) use-of-uninitialized-value
10- endif
You can’t perform that action at this time.
0 commit comments