1
Fork 0

Auto merge of #57388 - euclio:runmake-explicit-ignore, r=kennytm

use ignore directives for run-make tests

This makes the tests easier to read, and makes it possible to tell which
tests aren't being run on the host platform.

Fixes #56704.
This commit is contained in:
bors 2019-02-12 08:19:35 +00:00
commit a54b5c7a64
47 changed files with 127 additions and 297 deletions

View file

@ -1,14 +1,12 @@
-include ../tools.mk -include ../tools.mk
# ignore-macos
#
# This hits an assertion in the linker on older versions of osx apparently # This hits an assertion in the linker on older versions of osx apparently
ifeq ($(shell uname),Darwin)
all:
echo ignored
else
all: $(call DYLIB,cfoo) all: $(call DYLIB,cfoo)
$(RUSTC) foo.rs -C prefer-dynamic $(RUSTC) foo.rs -C prefer-dynamic
$(RUSTC) bar.rs $(RUSTC) bar.rs
$(call RUN,bar) $(call RUN,bar)
$(call REMOVE_DYLIBS,cfoo) $(call REMOVE_DYLIBS,cfoo)
$(call FAIL,bar) $(call FAIL,bar)
endif

View file

@ -1,17 +1,15 @@
-include ../tools.mk -include ../tools.mk
# ignore-macos
#
# This hits an assertion in the linker on older versions of osx apparently
# This overrides the LD_LIBRARY_PATH for RUN # This overrides the LD_LIBRARY_PATH for RUN
TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR) TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR)
# This hits an assertion in the linker on older versions of osx apparently
ifeq ($(shell uname),Darwin)
all:
echo ignored
else
all: $(call DYLIB,cfoo) all: $(call DYLIB,cfoo)
$(RUSTC) foo.rs $(RUSTC) foo.rs
$(RUSTC) bar.rs $(RUSTC) bar.rs
$(call RUN,bar) $(call RUN,bar)
$(call REMOVE_DYLIBS,cfoo) $(call REMOVE_DYLIBS,cfoo)
$(call FAIL,bar) $(call FAIL,bar)
endif

View file

@ -1,7 +1,8 @@
-include ../tools.mk -include ../tools.mk
# FIXME: ignore freebsd # ignore-freebsd
ifneq ($(shell uname),FreeBSD) # FIXME
all: all:
$(RUSTC) foo.rs $(RUSTC) foo.rs
$(CC) bar.c $(call STATICLIB,foo) $(call OUT_EXE,bar) \ $(CC) bar.c $(call STATICLIB,foo) $(call OUT_EXE,bar) \
@ -9,8 +10,3 @@ all:
$(call RUN,bar) $(call RUN,bar)
rm $(call STATICLIB,foo) rm $(call STATICLIB,foo)
$(call RUN,bar) $(call RUN,bar)
else
all:
endif

View file

@ -3,13 +3,10 @@
-include ../tools.mk -include ../tools.mk
# ignore-windows
# FIXME: The __rdl_ and __rust_ symbol still remains, no matter using MSVC or GNU # FIXME: The __rdl_ and __rust_ symbol still remains, no matter using MSVC or GNU
# See https://github.com/rust-lang/rust/pull/46207#issuecomment-347561753 # See https://github.com/rust-lang/rust/pull/46207#issuecomment-347561753
ifdef IS_WINDOWS
all:
true
else
all: all:
$(RUSTC) foo.rs $(RUSTC) foo.rs
nm -g "$(call DYLIB,foo)" | $(CGREP) -v __rdl_ __rde_ __rg_ __rust_ nm -g "$(call DYLIB,foo)" | $(CGREP) -v __rdl_ __rde_ __rg_ __rust_
endif

View file

@ -1,17 +1,9 @@
-include ../tools.mk -include ../tools.mk
ifneq (,$(findstring MINGW,$(UNAME))) # only-mingw
ifndef IS_MSVC
all: all:
$(CXX) foo.cpp -c -o $(TMPDIR)/foo.o $(CXX) foo.cpp -c -o $(TMPDIR)/foo.o
$(AR) crus $(TMPDIR)/libfoo.a $(TMPDIR)/foo.o $(AR) crus $(TMPDIR)/libfoo.a $(TMPDIR)/foo.o
$(RUSTC) foo.rs -lfoo -lstdc++ $(RUSTC) foo.rs -lfoo -lstdc++
$(call RUN,foo) $(call RUN,foo)
else
all:
endif
else
all:
endif

View file

@ -1,9 +1,9 @@
-include ../tools.mk -include ../tools.mk
# FIXME: ignore freebsd/windows # ignore-windows
# (windows: see `../dep-info/Makefile`) # ignore-freebsd
ifneq ($(shell uname),FreeBSD) # FIXME: (windows: see `../dep-info/Makefile`)
ifndef IS_WINDOWS
all: all:
cp lib.rs $(TMPDIR)/ cp lib.rs $(TMPDIR)/
cp 'foo foo.rs' $(TMPDIR)/ cp 'foo foo.rs' $(TMPDIR)/
@ -17,12 +17,3 @@ all:
pwd pwd
$(MAKE) -drf Makefile.foo $(MAKE) -drf Makefile.foo
rm $(TMPDIR)/done && exit 1 || exit 0 rm $(TMPDIR)/done && exit 1 || exit 0
else
all:
endif
else
all:
endif

View file

@ -1,11 +1,11 @@
-include ../tools.mk -include ../tools.mk
# FIXME: ignore freebsd/windows # ignore-windows
# on windows `rustc --dep-info` produces Makefile dependency with # ignore-freebsd
# FIXME: on windows `rustc --dep-info` produces Makefile dependency with
# windows native paths (e.g. `c:\path\to\libfoo.a`) # windows native paths (e.g. `c:\path\to\libfoo.a`)
# but msys make seems to fail to recognize such paths, so test fails. # but msys make seems to fail to recognize such paths, so test fails.
ifneq ($(shell uname),FreeBSD)
ifndef IS_WINDOWS
all: all:
cp *.rs $(TMPDIR) cp *.rs $(TMPDIR)
$(RUSTC) --emit dep-info,link --crate-type=lib $(TMPDIR)/lib.rs $(RUSTC) --emit dep-info,link --crate-type=lib $(TMPDIR)/lib.rs
@ -23,12 +23,3 @@ all:
rm $(TMPDIR)/bar.rs rm $(TMPDIR)/bar.rs
cp $(TMPDIR)/lib2.rs $(TMPDIR)/lib.rs cp $(TMPDIR)/lib2.rs $(TMPDIR)/lib.rs
$(MAKE) -drf Makefile.foo $(MAKE) -drf Makefile.foo
else
all:
endif
else
all:
endif

View file

@ -1,31 +1,13 @@
-include ../tools.mk -include ../tools.mk
# ignore-windows
# ignore-macos
# min-llvm-version 6.0
#
# This feature only works when the output object format is ELF so we ignore # This feature only works when the output object format is ELF so we ignore
# macOS and Windows # macOS and Windows
ifdef IS_WINDOWS
# Do nothing on Windows.
all:
exit 0
else ifneq (,$(filter $(TARGET),i686-apple-darwin x86_64-apple-darwin))
# Do nothing on macOS.
all:
exit 0
else
# check that the .stack_sizes section is generated # check that the .stack_sizes section is generated
# this test requires LLVM >= 6.0.0
vers = $(shell $(RUSTC) -Vv)
ifneq (,$(findstring LLVM version: 3,$(vers)))
all:
exit 0
else ifneq (,$(findstring LLVM version: 4,$(vers)))
all:
exit 0
else ifneq (,$(findstring LLVM version: 5,$(vers)))
all:
exit 0
else
all: all:
$(RUSTC) -C opt-level=3 -Z emit-stack-sizes --emit=obj foo.rs $(RUSTC) -C opt-level=3 -Z emit-stack-sizes --emit=obj foo.rs
size -A $(TMPDIR)/foo.o | $(CGREP) .stack_sizes size -A $(TMPDIR)/foo.o | $(CGREP) .stack_sizes
endif
endif

View file

@ -1,13 +1,10 @@
-include ../tools.mk -include ../tools.mk
# ignore-windows
# ignore-macos
# Test for #39529. # Test for #39529.
# `-z text` causes ld to error if there are any non-PIC sections # `-z text` causes ld to error if there are any non-PIC sections
ifeq ($(UNAME),Darwin)
all:
else ifdef IS_WINDOWS
all:
else
all: all:
$(RUSTC) hello.rs -C link-args=-Wl,-z,text $(RUSTC) hello.rs -C link-args=-Wl,-z,text
endif

View file

@ -1,20 +1,11 @@
-include ../tools.mk -include ../tools.mk
# FIXME: ignore freebsd/windows # ignore-windows
# on windows `rustc --dep-info` produces Makefile dependency with # ignore-freebsd
# FIXME: on windows `rustc --dep-info` produces Makefile dependency with
# windows native paths (e.g. `c:\path\to\libfoo.a`) # windows native paths (e.g. `c:\path\to\libfoo.a`)
# but msys make seems to fail to recognize such paths, so test fails. # but msys make seems to fail to recognize such paths, so test fails.
ifneq ($(shell uname),FreeBSD)
ifndef IS_WINDOWS
all: all:
$(RUSTC) --emit dep-info main.rs $(RUSTC) --emit dep-info main.rs
$(CGREP) "input.txt" "input.bin" "input.md" < $(TMPDIR)/main.d $(CGREP) "input.txt" "input.bin" "input.md" < $(TMPDIR)/main.d
else
all:
endif
else
all:
endif

View file

@ -1,15 +1,11 @@
-include ../tools.mk -include ../tools.mk
ifndef IS_WINDOWS # ignore-windows
# The assembly for exit-unreachable.rs should be shorter because it's missing #
# (at minimum) a return instruction. # Because of Windows exception handling, the code is not necessarily any shorter.
# https://github.com/llvm-mirror/llvm/commit/64b2297786f7fd6f5fa24cdd4db0298fbf211466
all: all:
$(RUSTC) -O --emit asm exit-ret.rs $(RUSTC) -O --emit asm exit-ret.rs
$(RUSTC) -O --emit asm exit-unreachable.rs $(RUSTC) -O --emit asm exit-unreachable.rs
test `wc -l < $(TMPDIR)/exit-unreachable.s` -lt `wc -l < $(TMPDIR)/exit-ret.s` test `wc -l < $(TMPDIR)/exit-unreachable.s` -lt `wc -l < $(TMPDIR)/exit-ret.s`
else
# Because of Windows exception handling, the code is not necessarily any shorter.
# https://github.com/llvm-mirror/llvm/commit/64b2297786f7fd6f5fa24cdd4db0298fbf211466
all:
endif

View file

@ -1,12 +1,10 @@
-include ../tools.mk -include ../tools.mk
ifeq ($(UNAME),Linux) # only-linux
all: all:
$(RUSTC) foo.rs $(RUSTC) foo.rs
$(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -ldl -o $(TMPDIR)/foo $(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -ldl -o $(TMPDIR)/foo
$(call RUN,foo) $(call RUN,foo)
$(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -ldl -pie -fPIC -o $(TMPDIR)/foo $(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -ldl -pie -fPIC -o $(TMPDIR)/foo
$(call RUN,foo) $(call RUN,foo)
else
all:
endif

View file

@ -1,8 +1,9 @@
-include ../tools.mk -include ../tools.mk
# ignore-windows
OUT := $(TMPDIR)/out OUT := $(TMPDIR)/out
ifndef IS_WINDOWS
all: time all: time
time: libc time: libc
@ -13,6 +14,3 @@ time: libc
libc: libc:
mkdir -p $(OUT)/libc mkdir -p $(OUT)/libc
$(RUSTC) in/libc/lib.rs --crate-name=libc -Cmetadata=foo -o $(OUT)/libc/liblibc.rlib $(RUSTC) in/libc/lib.rs --crate-name=libc -Cmetadata=foo -o $(OUT)/libc/liblibc.rlib
else
all:
endif

View file

@ -1,21 +1,12 @@
-include ../tools.mk -include ../tools.mk
ifeq (musl,$(findstring musl,$(TARGET))) # ignore-musl
all: skip
else
all: test
endif
test: foo all: foo
$(call RUN,foo) $(call RUN,foo)
skip:
echo "expected failure"
foo: foo.rs $(call NATIVE_STATICLIB,foo) foo: foo.rs $(call NATIVE_STATICLIB,foo)
$(RUSTC) $< -lfoo $(EXTRACXXFLAGS) $(RUSTC) $< -lfoo $(EXTRACXXFLAGS)
$(TMPDIR)/libfoo.o: foo.cpp $(TMPDIR)/libfoo.o: foo.cpp
$(call COMPILE_OBJ_CXX,$@,$<) $(call COMPILE_OBJ_CXX,$@,$<)
.PHONY: all test skip

View file

@ -1,12 +1,8 @@
-include ../tools.mk -include ../tools.mk
ifeq ($(findstring stage1,$(RUST_BUILD_STAGE)),stage1) # ignore-stage1
# ignore stage1
all:
else
all: all:
$(RUSTC) a.rs && $(RUSTC) b.rs $(RUSTC) a.rs && $(RUSTC) b.rs
$(BARE_RUSTC) c.rs -L dependency=$(TMPDIR) --extern b=$(TMPDIR)/libb.rlib \ $(BARE_RUSTC) c.rs -L dependency=$(TMPDIR) --extern b=$(TMPDIR)/libb.rlib \
--out-dir=$(TMPDIR) --out-dir=$(TMPDIR)
endif

View file

@ -1,10 +1,6 @@
-include ../tools.mk -include ../tools.mk
ifeq ($(findstring stage1,$(RUST_BUILD_STAGE)),stage1) # ignore-stage1
# ignore stage1
all:
else
all: all:
$(RUSTC) a.rs && $(RUSTC) b.rs && $(RUSTC) c.rs $(RUSTC) a.rs && $(RUSTC) b.rs && $(RUSTC) c.rs
endif

View file

@ -1,13 +1,9 @@
-include ../tools.mk -include ../tools.mk
ifdef IS_WINDOWS # ignore-windows
# Do nothing on MSVC.
all:
exit 0
else
all: all:
$(RUSTC) --emit=obj app.rs $(RUSTC) --emit=obj app.rs
nm $(TMPDIR)/app.o | $(CGREP) rust_begin_unwind nm $(TMPDIR)/app.o | $(CGREP) rust_begin_unwind
nm $(TMPDIR)/app.o | $(CGREP) rust_eh_personality nm $(TMPDIR)/app.o | $(CGREP) rust_eh_personality
nm $(TMPDIR)/app.o | $(CGREP) rust_oom nm $(TMPDIR)/app.o | $(CGREP) rust_oom
endif

View file

@ -1,6 +1,6 @@
-include ../tools.mk -include ../tools.mk
ifeq ($(if $(IS_WINDOWS),$(IS_MSVC),no),) # only-mingw
all: empty.rs all: empty.rs
cp -r $(shell cygpath -u $(shell $(RUSTC) --print sysroot)) $(TMPDIR)/sysroot cp -r $(shell cygpath -u $(shell $(RUSTC) --print sysroot)) $(TMPDIR)/sysroot
@ -8,9 +8,3 @@ all: empty.rs
mkdir -p $(TMPDIR)/obj mkdir -p $(TMPDIR)/obj
mv $(TMPDIR)/sysroot/lib/rustlib/$(TARGET)/lib/crt2.o $(TMPDIR)/obj/crt2.o mv $(TMPDIR)/sysroot/lib/rustlib/$(TARGET)/lib/crt2.o $(TMPDIR)/obj/crt2.o
$(RUSTC) --target $(TARGET) --sysroot $(TMPDIR)/sysroot -L$(TMPDIR)/obj -Z print-link-args empty.rs | $(CGREP) 'obj\\crt2.o' $(RUSTC) --target $(TARGET) --sysroot $(TMPDIR)/sysroot -L$(TMPDIR)/obj -Z print-link-args empty.rs | $(CGREP) 'obj\\crt2.o'
else
all:
endif

View file

@ -1,8 +1,6 @@
-include ../tools.mk -include ../tools.mk
ifdef IS_WINDOWS # ignore-windows
all:
else
NAME := $(shell $(RUSTC) --print file-names foo.rs) NAME := $(shell $(RUSTC) --print file-names foo.rs)
@ -11,4 +9,3 @@ all:
$(RUSTC) foo.rs -o $(TMPDIR)/outdir/$(NAME) $(RUSTC) foo.rs -o $(TMPDIR)/outdir/$(NAME)
ln -nsf outdir/$(NAME) $(TMPDIR) ln -nsf outdir/$(NAME) $(TMPDIR)
RUST_LOG=rustc_metadata::loader $(RUSTC) bar.rs RUST_LOG=rustc_metadata::loader $(RUSTC) bar.rs
endif

View file

@ -2,16 +2,16 @@
# Make sure we don't ICE if the linker prints a non-UTF-8 error message. # Make sure we don't ICE if the linker prints a non-UTF-8 error message.
# Ignore Windows and Apple # ignore-windows
#
# This does not work in its current form on windows, possibly due to # This does not work in its current form on windows, possibly due to
# gcc bugs or something about valid Windows paths. See issue #29151 # gcc bugs or something about valid Windows paths. See issue #29151
# for more information. # for more information.
ifndef IS_WINDOWS
# ignore-macos
#
# This also does not work on Apple APFS due to the filesystem requiring # This also does not work on Apple APFS due to the filesystem requiring
# valid UTF-8 paths. # valid UTF-8 paths.
ifneq ($(shell uname),Darwin)
# The zzz it to allow humans to tab complete or glob this thing. # The zzz it to allow humans to tab complete or glob this thing.
bad_dir := $(TMPDIR)/zzz$$'\xff' bad_dir := $(TMPDIR)/zzz$$'\xff'
@ -21,12 +21,3 @@ all:
mkdir $(bad_dir) mkdir $(bad_dir)
mv $(TMPDIR)/liblibrary.a $(bad_dir) mv $(TMPDIR)/liblibrary.a $(bad_dir)
LIBRARY_PATH=$(bad_dir) $(RUSTC) exec.rs 2>&1 | $(CGREP) this_symbol_not_defined LIBRARY_PATH=$(bad_dir) $(RUSTC) exec.rs 2>&1 | $(CGREP) this_symbol_not_defined
else
all:
endif
else
all:
endif

View file

@ -1,5 +1,7 @@
-include ../tools.mk -include ../tools.mk
# only-linux
# This tests ensure that global variables respect the target minimum alignment. # This tests ensure that global variables respect the target minimum alignment.
# The three bools `STATIC_BOOL`, `STATIC_MUT_BOOL`, and `CONST_BOOL` all have # The three bools `STATIC_BOOL`, `STATIC_MUT_BOOL`, and `CONST_BOOL` all have
# type-alignment of 1, but some targets require greater global alignment. # type-alignment of 1, but some targets require greater global alignment.
@ -8,7 +10,6 @@ SRC = min_global_align.rs
LL = $(TMPDIR)/min_global_align.ll LL = $(TMPDIR)/min_global_align.ll
all: all:
ifeq ($(UNAME),Linux)
# Most targets are happy with default alignment -- take i686 for example. # Most targets are happy with default alignment -- take i686 for example.
ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86) ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86)
$(RUSTC) --target=i686-unknown-linux-gnu --emit=llvm-ir $(SRC) $(RUSTC) --target=i686-unknown-linux-gnu --emit=llvm-ir $(SRC)
@ -19,4 +20,3 @@ ifeq ($(filter systemz,$(LLVM_COMPONENTS)),systemz)
$(RUSTC) --target=s390x-unknown-linux-gnu --emit=llvm-ir $(SRC) $(RUSTC) --target=s390x-unknown-linux-gnu --emit=llvm-ir $(SRC)
[ "$$(grep -c 'align 2' "$(LL)")" -eq "3" ] [ "$$(grep -c 'align 2' "$(LL)")" -eq "3" ]
endif endif
endif

View file

@ -1,7 +1,8 @@
-include ../tools.mk -include ../tools.mk
# only-linux
# only-x86_64
all: all:
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
$(RUSTC) hello.rs -C no_integrated_as $(RUSTC) hello.rs -C no_integrated_as
$(call RUN,hello) $(call RUN,hello)
endif

View file

@ -1,10 +1,10 @@
-include ../tools.mk -include ../tools.mk
# ignore-windows
all: all:
ifeq ($(PROFILER_SUPPORT),1) ifeq ($(PROFILER_SUPPORT),1)
ifndef IS_WINDOWS
$(RUSTC) -Copt-level=3 -Clto=fat -Z pgo-gen="$(TMPDIR)/test.profraw" test.rs $(RUSTC) -Copt-level=3 -Clto=fat -Z pgo-gen="$(TMPDIR)/test.profraw" test.rs
$(call RUN,test) || exit 1 $(call RUN,test) || exit 1
[ -e "$(TMPDIR)/test.profraw" ] || (echo "No .profraw file"; exit 1) [ -e "$(TMPDIR)/test.profraw" ] || (echo "No .profraw file"; exit 1)
endif endif
endif

View file

@ -1,10 +1,10 @@
-include ../tools.mk -include ../tools.mk
# ignore-windows
all: all:
ifeq ($(PROFILER_SUPPORT),1) ifeq ($(PROFILER_SUPPORT),1)
ifndef IS_WINDOWS
$(RUSTC) -g -Z pgo-gen="$(TMPDIR)/test.profraw" test.rs $(RUSTC) -g -Z pgo-gen="$(TMPDIR)/test.profraw" test.rs
$(call RUN,test) || exit 1 $(call RUN,test) || exit 1
[ -e "$(TMPDIR)/test.profraw" ] || (echo "No .profraw file"; exit 1) [ -e "$(TMPDIR)/test.profraw" ] || (echo "No .profraw file"; exit 1)
endif endif
endif

View file

@ -1,11 +1,9 @@
-include ../tools.mk -include ../tools.mk
ifdef IS_WINDOWS
# ignore windows # ignore-windows
RUSTC_FLAGS =
else
# Notice the space in the end, this emulates the output of pkg-config # Notice the space in the end, this emulates the output of pkg-config
RUSTC_FLAGS = -C link-args="-lc " RUSTC_FLAGS = -C link-args="-lc "
endif
all: all:
$(RUSTC) $(RUSTC_FLAGS) empty.rs $(RUSTC) $(RUSTC_FLAGS) empty.rs

View file

@ -1,9 +1,10 @@
-include ../tools.mk -include ../tools.mk
# only-linux
#
# This tests the different -Zrelro-level values, and makes sure that they work properly. # This tests the different -Zrelro-level values, and makes sure that they work properly.
all: all:
ifeq ($(UNAME),Linux)
# Ensure that binaries built with the full relro level links them with both # Ensure that binaries built with the full relro level links them with both
# RELRO and BIND_NOW for doing eager symbol resolving. # RELRO and BIND_NOW for doing eager symbol resolving.
$(RUSTC) -Zrelro-level=full hello.rs $(RUSTC) -Zrelro-level=full hello.rs
@ -18,4 +19,3 @@ ifeq ($(UNAME),Linux)
# enabled by default. # enabled by default.
$(RUSTC) -Zrelro-level=off hello.rs $(RUSTC) -Zrelro-level=off hello.rs
! readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO ! readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO
endif

View file

@ -4,10 +4,10 @@
# while generating files. Ideally this would be a rustdoc-ui test, so we could # while generating files. Ideally this would be a rustdoc-ui test, so we could
# verify the error message as well. # verify the error message as well.
OUTPUT_DIR := "$(TMPDIR)/rustdoc-io-error" # ignore-windows
# The test uses `chmod`.
# Ignore Windows: the test uses `chmod`. OUTPUT_DIR := "$(TMPDIR)/rustdoc-io-error"
ifndef IS_WINDOWS
# This test operates by creating a temporary directory and modifying its # This test operates by creating a temporary directory and modifying its
# permissions so that it is not writable. We have to take special care to set # permissions so that it is not writable. We have to take special care to set
@ -18,8 +18,3 @@ all:
-$(shell $(RUSTDOC) -o $(OUTPUT_DIR) foo.rs) -$(shell $(RUSTDOC) -o $(OUTPUT_DIR) foo.rs)
chmod u+w $(OUTPUT_DIR) chmod u+w $(OUTPUT_DIR)
exit $($(.SHELLSTATUS) -eq 1) exit $($(.SHELLSTATUS) -eq 1)
else
all:
endif

View file

@ -1,16 +1,12 @@
-include ../tools.mk -include ../tools.mk
# only-linux
# only-x86_64
# ignore-test
# FIXME(#46126) ThinLTO for libstd broke this test # FIXME(#46126) ThinLTO for libstd broke this test
ifeq (1,0)
all: all:
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
ifdef SANITIZER_SUPPORT ifdef SANITIZER_SUPPORT
$(RUSTC) -C opt-level=1 -g -Z sanitizer=leak -Z print-link-args leak.rs | $(CGREP) librustc_lsan $(RUSTC) -C opt-level=1 -g -Z sanitizer=leak -Z print-link-args leak.rs | $(CGREP) librustc_lsan
$(TMPDIR)/leak 2>&1 | $(CGREP) 'detected memory leaks' $(TMPDIR)/leak 2>&1 | $(CGREP) 'detected memory leaks'
endif endif
endif
else
all:
endif

View file

@ -1,10 +1,10 @@
-include ../tools.mk -include ../tools.mk
# only-linux
# only-x86_64
all: all:
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
ifdef SANITIZER_SUPPORT ifdef SANITIZER_SUPPORT
$(RUSTC) -g -Z sanitizer=memory -Z print-link-args uninit.rs | $(CGREP) librustc_msan $(RUSTC) -g -Z sanitizer=memory -Z print-link-args uninit.rs | $(CGREP) librustc_msan
$(TMPDIR)/uninit 2>&1 | $(CGREP) use-of-uninitialized-value $(TMPDIR)/uninit 2>&1 | $(CGREP) use-of-uninitialized-value
endif endif
endif

View file

@ -1,12 +1,9 @@
include ../tools.mk include ../tools.mk
ifdef IS_WINDOWS # ignore-windows
# Do nothing on MSVC. #
# On MINGW the --version-script, --dynamic-list, and --retain-symbol args don't # On MINGW the --version-script, --dynamic-list, and --retain-symbol args don't
# seem to work reliably. # seem to work reliably.
all:
exit 0
else
NM=nm -D NM=nm -D
CDYLIB_NAME=liba_cdylib.so CDYLIB_NAME=liba_cdylib.so
@ -89,4 +86,3 @@ all:
# Check that an executable does not export any dynamic symbols # Check that an executable does not export any dynamic symbols
[ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -c public_c_function_from_rlib)" -eq "0" ] [ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -c public_c_function_from_rlib)" -eq "0" ]
[ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -c public_rust_function_from_exe)" -eq "0" ] [ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -c public_rust_function_from_exe)" -eq "0" ]
endif

View file

@ -1,7 +1,7 @@
-include ../tools.mk -include ../tools.mk
# ignore windows: `ln` is actually `cp` on msys. # ignore-windows
ifndef IS_WINDOWS # `ln` is actually `cp` on msys.
all: all:
$(RUSTC) foo.rs $(RUSTC) foo.rs
@ -9,8 +9,3 @@ all:
ln -nsf $(TMPDIR)/libfoo.rlib $(TMPDIR)/other ln -nsf $(TMPDIR)/libfoo.rlib $(TMPDIR)/other
$(RUSTC) bar.rs -L $(TMPDIR) $(RUSTC) bar.rs -L $(TMPDIR)
$(RUSTC) baz.rs --extern foo=$(TMPDIR)/other/libfoo.rlib -L $(TMPDIR) $(RUSTC) baz.rs --extern foo=$(TMPDIR)/other/libfoo.rlib -L $(TMPDIR)
else
all:
endif

View file

@ -1,15 +1,10 @@
-include ../tools.mk -include ../tools.mk
# ignore windows: `ln` is actually `cp` on msys. # ignore-windows
ifndef IS_WINDOWS # `ln` is actually `cp` on msys.
all: all:
$(RUSTC) foo.rs -C prefer-dynamic $(RUSTC) foo.rs -C prefer-dynamic
mkdir -p $(TMPDIR)/other mkdir -p $(TMPDIR)/other
ln -nsf $(TMPDIR)/$(call DYLIB_GLOB,foo) $(TMPDIR)/other ln -nsf $(TMPDIR)/$(call DYLIB_GLOB,foo) $(TMPDIR)/other
$(RUSTC) bar.rs -L $(TMPDIR)/other $(RUSTC) bar.rs -L $(TMPDIR)/other
else
all:
endif

View file

@ -1,14 +1,9 @@
-include ../tools.mk -include ../tools.mk
# ignore windows: `ln` is actually `cp` on msys. # ignore-windows
ifndef IS_WINDOWS # `ln` is actually `cp` on msys.
all: all:
$(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/foo.xxx $(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/foo.xxx
ln -nsf $(TMPDIR)/foo.xxx $(TMPDIR)/libfoo.rlib ln -nsf $(TMPDIR)/foo.xxx $(TMPDIR)/libfoo.rlib
$(RUSTC) bar.rs -L $(TMPDIR) $(RUSTC) bar.rs -L $(TMPDIR)
else
all:
endif

View file

@ -1,8 +1,11 @@
-include ../tools.mk -include ../tools.mk
# only-linux
# only-x86_64
#
# I *really* don't want to deal with a cross-platform way to compare file sizes, # I *really* don't want to deal with a cross-platform way to compare file sizes,
# tests in `make` sort of are awful # tests in `make` sort of are awful
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
all: $(TMPDIR)/out.log all: $(TMPDIR)/out.log
# Make sure no warnings about "unknown CPU `native`" were emitted # Make sure no warnings about "unknown CPU `native`" were emitted
if [ "$$(wc -c $(TMPDIR)/out.log | cut -d' ' -f 1)" = "0" ]; then \ if [ "$$(wc -c $(TMPDIR)/out.log | cut -d' ' -f 1)" = "0" ]; then \
@ -10,9 +13,6 @@ all: $(TMPDIR)/out.log
else \ else \
exit 1; \ exit 1; \
fi fi
else
all: $(TMPDIR)/out.log
endif
$(TMPDIR)/out.log: $(TMPDIR)/out.log:

View file

@ -1,8 +1,9 @@
-include ../tools.mk -include ../tools.mk
SKIP_OS := 'FreeBSD OpenBSD Bitrig SunOS' # ignore-freebsd
# ignore-openbsd
ifneq ($(UNAME),$(findstring $(UNAME),$(SKIP_OS))) # ignore-bitrig
# ignore-sunos
HOST := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //') HOST := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //')
ifeq ($(findstring i686,$(HOST)),i686) ifeq ($(findstring i686,$(HOST)),i686)
@ -15,7 +16,3 @@ all:
$(RUSTC) foo.rs -C extra-filename=-host $(RUSTC) foo.rs -C extra-filename=-host
$(RUSTC) bar.rs -C extra-filename=-targ --target $(TARGET) $(RUSTC) bar.rs -C extra-filename=-targ --target $(TARGET)
$(RUSTC) baz.rs --extern a=$(TMPDIR)/liba-targ.rlib --target $(TARGET) $(RUSTC) baz.rs --extern a=$(TMPDIR)/liba-targ.rlib --target $(TARGET)
else
# FreeBSD, OpenBSD, and Bitrig support only x86_64 architecture for now
all:
endif

View file

@ -1,11 +1,7 @@
-include ../tools.mk -include ../tools.mk
ifdef IS_WINDOWS # ignore-windows
# Do nothing on MSVC.
all:
exit 0
else
all: all:
$(RUSTC) -C opt-level=3 --emit=obj used.rs $(RUSTC) -C opt-level=3 --emit=obj used.rs
nm $(TMPDIR)/used.o | $(CGREP) FOO nm $(TMPDIR)/used.o | $(CGREP) FOO
endif

View file

@ -1,14 +1,8 @@
-include ../tools.mk -include ../tools.mk
ifdef IS_WINDOWS # only-windows
all: all:
$(RUSTC) -o "$(TMPDIR)/hopefullydoesntexist bar.exe" hello.rs $(RUSTC) -o "$(TMPDIR)/hopefullydoesntexist bar.exe" hello.rs
$(RUSTC) spawn.rs $(RUSTC) spawn.rs
$(TMPDIR)/spawn.exe $(TMPDIR)/spawn.exe
else
all:
endif

View file

@ -10,8 +10,10 @@
# - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat) # - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat)
# - thumbv7m-none-eabi (Bare Cortex-M3) # - thumbv7m-none-eabi (Bare Cortex-M3)
# See https://stackoverflow.com/questions/7656425/makefile-ifeq-logical-or # only-thumbv6m-none-eabi
ifneq (,$(filter $(TARGET),thumbv6m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf thumbv7m-none-eabi)) # only-thumbv7em-none-eabi
# only-thumbv7em-none-eabihf
# only-thumbv7m-none-eabi
# For cargo setting # For cargo setting
RUSTC := $(RUSTC_ORIGINAL) RUSTC := $(RUSTC_ORIGINAL)
@ -36,8 +38,3 @@ all:
# These come from the top-level Rust workspace, that this crate is not a # These come from the top-level Rust workspace, that this crate is not a
# member of, but Cargo tries to load the workspace `Cargo.toml` anyway. # member of, but Cargo tries to load the workspace `Cargo.toml` anyway.
cd $(WORK_DIR) && cd $(CRATE) && env RUSTC_BOOTSTRAP=1 $(CARGO) build --target $(TARGET) -v cd $(WORK_DIR) && cd $(CRATE) && env RUSTC_BOOTSTRAP=1 $(CARGO) build --target $(TARGET) -v
else
all:
endif

View file

@ -1,11 +1,12 @@
-include ../../run-make-fulldeps/tools.mk -include ../../run-make-fulldeps/tools.mk
# only-thumbv7m-none-eabi
# only-thumbv6m-none-eabi
# How to run this # How to run this
# $ ./x.py clean # $ ./x.py clean
# $ ./x.py test --target thumbv7m-none-eabi src/test/run-make # $ ./x.py test --target thumbv7m-none-eabi src/test/run-make
ifneq (,$(filter $(TARGET),thumbv6m-none-eabi thumbv7m-none-eabi))
# For cargo setting # For cargo setting
export RUSTC := $(RUSTC_ORIGINAL) export RUSTC := $(RUSTC_ORIGINAL)
export LD_LIBRARY_PATH := $(HOST_RPATH_DIR) export LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
@ -25,6 +26,3 @@ unexport CXX
all: all:
bash script.sh bash script.sh
else
all:
endif

View file

@ -1,10 +1,8 @@
-include ../../run-make-fulldeps/tools.mk -include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown) # only-wasm32
all: all:
$(RUSTC) foo.rs --target wasm32-unknown-unknown $(RUSTC) foo.rs --target wasm32-unknown-unknown
$(RUSTC) bar.rs -C lto -O --target wasm32-unknown-unknown $(RUSTC) bar.rs -C lto -O --target wasm32-unknown-unknown
$(NODE) foo.js $(TMPDIR)/bar.wasm $(NODE) foo.js $(TMPDIR)/bar.wasm
else
all:
endif

View file

@ -1,9 +1,7 @@
-include ../../run-make-fulldeps/tools.mk -include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown) # only-wasm32
all: all:
$(RUSTC) foo.rs -O --target wasm32-unknown-unknown $(RUSTC) foo.rs -O --target wasm32-unknown-unknown
$(NODE) foo.js $(TMPDIR)/foo.wasm $(NODE) foo.js $(TMPDIR)/foo.wasm
else
all:
endif

View file

@ -1,6 +1,7 @@
-include ../../run-make-fulldeps/tools.mk -include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown) # only-wasm32
all: all:
$(RUSTC) bar.rs --target wasm32-unknown-unknown $(RUSTC) bar.rs --target wasm32-unknown-unknown
$(RUSTC) foo.rs --target wasm32-unknown-unknown $(RUSTC) foo.rs --target wasm32-unknown-unknown
@ -10,7 +11,3 @@ all:
$(NODE) verify.js $(TMPDIR)/foo.wasm $(NODE) verify.js $(TMPDIR)/foo.wasm
$(RUSTC) foo.rs --target wasm32-unknown-unknown -C lto $(RUSTC) foo.rs --target wasm32-unknown-unknown -C lto
$(NODE) verify.js $(TMPDIR)/foo.wasm $(NODE) verify.js $(TMPDIR)/foo.wasm
else
all:
endif

View file

@ -1,10 +1,8 @@
-include ../../run-make-fulldeps/tools.mk -include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown) # only-wasm32
all: all:
$(RUSTC) foo.rs --target wasm32-unknown-unknown $(RUSTC) foo.rs --target wasm32-unknown-unknown
$(RUSTC) bar.rs -C lto -O --target wasm32-unknown-unknown $(RUSTC) bar.rs -C lto -O --target wasm32-unknown-unknown
$(NODE) foo.js $(TMPDIR)/bar.wasm $(NODE) foo.js $(TMPDIR)/bar.wasm
else
all:
endif

View file

@ -1,6 +1,7 @@
-include ../../run-make-fulldeps/tools.mk -include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown) # only-wasm32
all: all:
$(RUSTC) foo.rs -C lto -O --target wasm32-unknown-unknown --cfg a $(RUSTC) foo.rs -C lto -O --target wasm32-unknown-unknown --cfg a
wc -c < $(TMPDIR)/foo.wasm wc -c < $(TMPDIR)/foo.wasm
@ -14,7 +15,3 @@ all:
$(RUSTC) foo.rs -C lto -O --target wasm32-unknown-unknown --cfg d $(RUSTC) foo.rs -C lto -O --target wasm32-unknown-unknown --cfg d
wc -c < $(TMPDIR)/foo.wasm wc -c < $(TMPDIR)/foo.wasm
[ "`wc -c < $(TMPDIR)/foo.wasm`" -lt "5120" ] [ "`wc -c < $(TMPDIR)/foo.wasm`" -lt "5120" ]
else
all:
endif

View file

@ -1,6 +1,7 @@
-include ../../run-make-fulldeps/tools.mk -include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown) # only-wasm32
all: all:
$(RUSTC) foo.rs --target wasm32-unknown-unknown $(RUSTC) foo.rs --target wasm32-unknown-unknown
$(NODE) verify-exported-symbols.js $(TMPDIR)/foo.wasm $(NODE) verify-exported-symbols.js $(TMPDIR)/foo.wasm
@ -10,7 +11,3 @@ all:
$(NODE) verify-exported-symbols.js $(TMPDIR)/bar.wasm $(NODE) verify-exported-symbols.js $(TMPDIR)/bar.wasm
$(RUSTC) bar.rs --target wasm32-unknown-unknown -O $(RUSTC) bar.rs --target wasm32-unknown-unknown -O
$(NODE) verify-exported-symbols.js $(TMPDIR)/bar.wasm $(NODE) verify-exported-symbols.js $(TMPDIR)/bar.wasm
else
all:
endif

View file

@ -1,6 +1,7 @@
-include ../../run-make-fulldeps/tools.mk -include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown) # only-wasm32
all: all:
$(RUSTC) foo.rs --target wasm32-unknown-unknown $(RUSTC) foo.rs --target wasm32-unknown-unknown
$(NODE) verify-no-imports.js $(TMPDIR)/foo.wasm $(NODE) verify-no-imports.js $(TMPDIR)/foo.wasm
@ -10,7 +11,3 @@ all:
$(NODE) verify-no-imports.js $(TMPDIR)/foo.wasm $(NODE) verify-no-imports.js $(TMPDIR)/foo.wasm
$(RUSTC) foo.rs --target wasm32-unknown-unknown -O -C lto $(RUSTC) foo.rs --target wasm32-unknown-unknown -O -C lto
$(NODE) verify-no-imports.js $(TMPDIR)/foo.wasm $(NODE) verify-no-imports.js $(TMPDIR)/foo.wasm
else
all:
endif

View file

@ -9,6 +9,7 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
("androideabi", "android"), ("androideabi", "android"),
("bitrig", "bitrig"), ("bitrig", "bitrig"),
("cloudabi", "cloudabi"), ("cloudabi", "cloudabi"),
("cuda", "cuda"),
("darwin", "macos"), ("darwin", "macos"),
("dragonfly", "dragonfly"), ("dragonfly", "dragonfly"),
("emscripten", "emscripten"), ("emscripten", "emscripten"),
@ -20,9 +21,11 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
("l4re", "l4re"), ("l4re", "l4re"),
("linux", "linux"), ("linux", "linux"),
("mingw32", "windows"), ("mingw32", "windows"),
("none", "none"),
("netbsd", "netbsd"), ("netbsd", "netbsd"),
("openbsd", "openbsd"), ("openbsd", "openbsd"),
("redox", "redox"), ("redox", "redox"),
("sgx", "sgx"),
("solaris", "solaris"), ("solaris", "solaris"),
("win32", "windows"), ("win32", "windows"),
("windows", "windows"), ("windows", "windows"),
@ -38,6 +41,7 @@ const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
("armv7", "arm"), ("armv7", "arm"),
("armv7s", "arm"), ("armv7s", "arm"),
("asmjs", "asmjs"), ("asmjs", "asmjs"),
("cuda", "cuda"),
("hexagon", "hexagon"), ("hexagon", "hexagon"),
("i386", "x86"), ("i386", "x86"),
("i586", "x86"), ("i586", "x86"),
@ -154,6 +158,7 @@ fn test_get_arch_failure() {
fn test_get_arch() { fn test_get_arch() {
assert_eq!("x86_64", get_arch("x86_64-unknown-linux-gnu")); assert_eq!("x86_64", get_arch("x86_64-unknown-linux-gnu"));
assert_eq!("x86_64", get_arch("amd64")); assert_eq!("x86_64", get_arch("amd64"));
assert_eq!("cuda", get_arch("nvptx64-nvidia-cuda"));
} }
#[test] #[test]
@ -168,4 +173,8 @@ fn test_matches_os() {
assert!(matches_os("wasm32-unknown-unknown", "emscripten")); assert!(matches_os("wasm32-unknown-unknown", "emscripten"));
assert!(matches_os("wasm32-unknown-unknown", "wasm32-bare")); assert!(matches_os("wasm32-unknown-unknown", "wasm32-bare"));
assert!(!matches_os("wasm32-unknown-unknown", "windows")); assert!(!matches_os("wasm32-unknown-unknown", "windows"));
assert!(matches_os("thumbv6m0-none-eabi", "none"));
assert!(matches_os("riscv32imc-unknown-none-elf", "none"));
assert!(matches_os("nvptx64-nvidia-cuda", "cuda"));
assert!(matches_os("x86_64-fortanix-unknown-sgx", "sgx"));
} }