File tree 11 files changed +20
-30
lines changed
src/test/run-make-fulldeps
sanitizer-invalid-cratetype
11 files changed +20
-30
lines changed Original file line number Diff line number Diff line change
1
+ # needs-profiler-support
2
+
1
3
-include ../tools.mk
2
4
3
5
all :
4
- ifeq ($(RUSTC_PROFILER_SUPPORT ) ,1)
5
6
$(RUSTC ) -Copt-level=3 -Clto=fat -Z pgo-gen=" $( TMPDIR) " test.rs
6
7
$(call RUN,test) || exit 1
7
8
[ -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
+
1
3
-include ../tools.mk
2
4
3
5
all :
4
- ifeq ($(RUSTC_PROFILER_SUPPORT ) ,1)
5
6
$(RUSTC ) -O -Ccodegen-units=1 -Z pgo-gen=" $( TMPDIR) " --emit=llvm-ir test.rs
6
7
# We expect symbols starting with "__llvm_profile_".
7
8
$(CGREP ) " __llvm_profile_" < $(TMPDIR ) /test.ll
8
9
# We do NOT expect the "__imp_" version of these symbols.
9
10
$(CGREP ) -v " __imp___llvm_profile_" < $(TMPDIR ) /test.ll # 64 bit
10
11
$(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
+
1
3
-include ../tools.mk
2
4
3
5
all :
4
- ifeq ($(RUSTC_PROFILER_SUPPORT ) ,1)
5
6
$(RUSTC ) -g -Z pgo-gen=" $( TMPDIR) " test.rs
6
7
$(call RUN,test) || exit 1
7
8
[ -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
+
1
3
-include ../tools.mk
2
4
3
5
all :
4
- ifeq ($(RUSTC_PROFILER_SUPPORT ) ,1)
5
6
$(RUSTC ) -g -Z profile test.rs
6
7
$(call RUN,test) || exit 1
7
8
[ -e " $( TMPDIR) /test.gcno" ] || (echo " No .gcno file" ; exit 1)
8
9
[ -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
+
1
3
-include ../tools.mk
2
4
3
5
LOG := $(TMPDIR ) /log.txt
4
6
5
7
# NOTE the address sanitizer only supports x86_64 linux and macOS
6
8
7
9
ifeq ($(TARGET ) ,x86_64-apple-darwin)
8
- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
9
10
EXTRA_RUSTFLAG =-C rpath
10
11
else
11
12
ifeq ($(TARGET ) ,x86_64-unknown-linux-gnu)
12
- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
13
13
14
14
# Apparently there are very specific Linux kernels, notably the one that's
15
15
# currently on Travis CI, which contain a buggy commit that triggers failures in
23
23
endif
24
24
25
25
all :
26
- ifeq ($(ASAN_SUPPORT ) ,1)
27
26
$(RUSTC ) -g -Z sanitizer=address -Z print-link-args $(EXTRA_RUSTFLAG ) overflow.rs | $(CGREP ) librustc_asan
28
27
$(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
+
1
3
-include ../tools.mk
2
4
3
5
LOG := $(TMPDIR ) /log.txt
@@ -8,15 +10,12 @@ LOG := $(TMPDIR)/log.txt
8
10
# is correctly detected.
9
11
10
12
ifeq ($(TARGET ) ,x86_64-unknown-linux-gnu)
11
- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
12
13
13
14
# See comment in sanitizer-address/Makefile for why this is here
14
15
EXTRA_RUSTFLAG =-C relocation-model=dynamic-no-pic
15
16
endif
16
17
17
18
all :
18
- ifeq ($(ASAN_SUPPORT ) ,1)
19
19
$(RUSTC ) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET ) $(EXTRA_RUSTFLAG ) library.rs
20
20
$(RUSTC ) -g -Z sanitizer=address --crate-type bin --target $(TARGET ) $(EXTRA_RUSTFLAG ) -llibrary program.rs
21
21
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
+
1
3
-include ../tools.mk
2
4
3
5
LOG := $(TMPDIR ) /log.txt
@@ -8,15 +10,11 @@ LOG := $(TMPDIR)/log.txt
8
10
# is correctly detected.
9
11
10
12
ifeq ($(TARGET ) ,x86_64-unknown-linux-gnu)
11
- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
12
-
13
13
# See comment in sanitizer-address/Makefile for why this is here
14
14
EXTRA_RUSTFLAG =-C relocation-model=dynamic-no-pic
15
15
endif
16
16
17
17
all :
18
- ifeq ($(ASAN_SUPPORT ) ,1)
19
18
$(RUSTC ) -g -Z sanitizer=address --crate-type dylib --target $(TARGET ) $(EXTRA_RUSTFLAG ) library.rs
20
19
$(RUSTC ) -g -Z sanitizer=address --crate-type bin --target $(TARGET ) $(EXTRA_RUSTFLAG ) -llibrary program.rs
21
20
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
+
1
3
-include ../tools.mk
2
4
3
5
# NOTE the address sanitizer only supports x86_64 linux and macOS
4
6
5
7
ifeq ($(TARGET ) ,x86_64-apple-darwin)
6
- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
7
8
EXTRA_RUSTFLAG =-C rpath
8
9
else
9
10
ifeq ($(TARGET ) ,x86_64-unknown-linux-gnu)
10
- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
11
11
EXTRA_RUSTFLAG =
12
12
endif
13
13
endif
14
14
15
15
all :
16
- ifeq ($(ASAN_SUPPORT ) ,1)
17
16
$(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 1
1
-include ../tools.mk
2
2
3
+ # needs-sanitizer-support
3
4
# only-linux
4
5
# only-x86_64
5
6
# ignore-test
6
7
# FIXME(#46126) ThinLTO for libstd broke this test
7
8
8
9
all :
9
- ifdef RUSTC_SANITIZER_SUPPORT
10
10
$(RUSTC ) -C opt-level=1 -g -Z sanitizer=leak -Z print-link-args leak.rs | $(CGREP ) librustc_lsan
11
11
$(TMPDIR ) /leak 2>&1 | $(CGREP ) ' detected memory leaks'
12
- endif
Original file line number Diff line number Diff line change 1
1
-include ../tools.mk
2
2
3
+ # needs-sanitizer-support
3
4
# only-linux
4
5
# only-x86_64
5
6
6
7
all :
7
- ifdef RUSTC_SANITIZER_SUPPORT
8
8
$(RUSTC ) -g -Z sanitizer=memory -Z print-link-args uninit.rs | $(CGREP ) librustc_msan
9
9
$(TMPDIR ) /uninit 2>&1 | $(CGREP ) use-of-uninitialized-value
10
- endif
Original file line number Diff line number Diff line change
1
+ # needs-sanitizer-support
2
+
1
3
-include ../tools.mk
2
4
3
5
# This test builds a staticlib, then an executable that links to it.
4
6
# The staticlib and executable both are compiled with address sanitizer,
5
7
# and we assert that a fault in the staticlib is correctly detected.
6
8
7
9
ifeq ($(TARGET ) ,x86_64-unknown-linux-gnu)
8
- ASAN_SUPPORT =$(RUSTC_SANITIZER_SUPPORT )
9
10
EXTRA_RUSTFLAG =
10
11
endif
11
12
12
13
all :
13
- ifeq ($(ASAN_SUPPORT ) ,1)
14
14
$(RUSTC ) -g -Z sanitizer=address --crate-type staticlib --target $(TARGET ) library.rs
15
15
$(CC ) program.c $(call STATICLIB,library) $(call OUT_EXE,program) $(EXTRACFLAGS ) $(EXTRACXXFLAGS )
16
16
LD_LIBRARY_PATH=$(TMPDIR ) $(TMPDIR ) /program 2>&1 | $(CGREP ) stack-buffer-overflow
17
- endif
18
17
You can’t perform that action at this time.
0 commit comments