Skip to content

Commit a54b5c7

Browse files
committed
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.
2 parents 75f9159 + f15d20c commit a54b5c7

File tree

47 files changed

+127
-297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+127
-297
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
-include ../tools.mk
22

3+
# ignore-macos
4+
#
35
# This hits an assertion in the linker on older versions of osx apparently
4-
ifeq ($(shell uname),Darwin)
5-
all:
6-
echo ignored
7-
else
6+
87
all: $(call DYLIB,cfoo)
98
$(RUSTC) foo.rs -C prefer-dynamic
109
$(RUSTC) bar.rs
1110
$(call RUN,bar)
1211
$(call REMOVE_DYLIBS,cfoo)
1312
$(call FAIL,bar)
14-
endif
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
-include ../tools.mk
22

3+
# ignore-macos
4+
#
5+
# This hits an assertion in the linker on older versions of osx apparently
6+
37
# This overrides the LD_LIBRARY_PATH for RUN
48
TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR)
59

6-
# This hits an assertion in the linker on older versions of osx apparently
7-
ifeq ($(shell uname),Darwin)
8-
all:
9-
echo ignored
10-
else
1110
all: $(call DYLIB,cfoo)
1211
$(RUSTC) foo.rs
1312
$(RUSTC) bar.rs
1413
$(call RUN,bar)
1514
$(call REMOVE_DYLIBS,cfoo)
1615
$(call FAIL,bar)
17-
endif
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
-include ../tools.mk
22

3-
# FIXME: ignore freebsd
4-
ifneq ($(shell uname),FreeBSD)
3+
# ignore-freebsd
4+
# FIXME
5+
56
all:
67
$(RUSTC) foo.rs
78
$(CC) bar.c $(call STATICLIB,foo) $(call OUT_EXE,bar) \
89
$(EXTRACFLAGS) $(EXTRACXXFLAGS)
910
$(call RUN,bar)
1011
rm $(call STATICLIB,foo)
1112
$(call RUN,bar)
12-
13-
else
14-
all:
15-
16-
endif

src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33

44
-include ../tools.mk
55

6+
# ignore-windows
67
# FIXME: The __rdl_ and __rust_ symbol still remains, no matter using MSVC or GNU
78
# See https://github.com/rust-lang/rust/pull/46207#issuecomment-347561753
8-
ifdef IS_WINDOWS
9-
all:
10-
true
11-
else
9+
1210
all:
1311
$(RUSTC) foo.rs
1412
nm -g "$(call DYLIB,foo)" | $(CGREP) -v __rdl_ __rde_ __rg_ __rust_
15-
endif
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
-include ../tools.mk
22

3-
ifneq (,$(findstring MINGW,$(UNAME)))
4-
ifndef IS_MSVC
3+
# only-mingw
4+
55
all:
66
$(CXX) foo.cpp -c -o $(TMPDIR)/foo.o
77
$(AR) crus $(TMPDIR)/libfoo.a $(TMPDIR)/foo.o
88
$(RUSTC) foo.rs -lfoo -lstdc++
99
$(call RUN,foo)
10-
else
11-
all:
12-
13-
endif
14-
else
15-
all:
16-
17-
endif
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
-include ../tools.mk
22

3-
# FIXME: ignore freebsd/windows
4-
# (windows: see `../dep-info/Makefile`)
5-
ifneq ($(shell uname),FreeBSD)
6-
ifndef IS_WINDOWS
3+
# ignore-windows
4+
# ignore-freebsd
5+
# FIXME: (windows: see `../dep-info/Makefile`)
6+
77
all:
88
cp lib.rs $(TMPDIR)/
99
cp 'foo foo.rs' $(TMPDIR)/
@@ -17,12 +17,3 @@ all:
1717
pwd
1818
$(MAKE) -drf Makefile.foo
1919
rm $(TMPDIR)/done && exit 1 || exit 0
20-
else
21-
all:
22-
23-
endif
24-
25-
else
26-
all:
27-
28-
endif
+4-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
-include ../tools.mk
22

3-
# FIXME: ignore freebsd/windows
4-
# on windows `rustc --dep-info` produces Makefile dependency with
3+
# ignore-windows
4+
# ignore-freebsd
5+
# FIXME: on windows `rustc --dep-info` produces Makefile dependency with
56
# windows native paths (e.g. `c:\path\to\libfoo.a`)
67
# but msys make seems to fail to recognize such paths, so test fails.
7-
ifneq ($(shell uname),FreeBSD)
8-
ifndef IS_WINDOWS
8+
99
all:
1010
cp *.rs $(TMPDIR)
1111
$(RUSTC) --emit dep-info,link --crate-type=lib $(TMPDIR)/lib.rs
@@ -23,12 +23,3 @@ all:
2323
rm $(TMPDIR)/bar.rs
2424
cp $(TMPDIR)/lib2.rs $(TMPDIR)/lib.rs
2525
$(MAKE) -drf Makefile.foo
26-
else
27-
all:
28-
29-
endif
30-
31-
else
32-
all:
33-
34-
endif
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
11
-include ../tools.mk
22

3+
# ignore-windows
4+
# ignore-macos
5+
# min-llvm-version 6.0
6+
#
37
# This feature only works when the output object format is ELF so we ignore
48
# macOS and Windows
5-
ifdef IS_WINDOWS
6-
# Do nothing on Windows.
7-
all:
8-
exit 0
9-
else ifneq (,$(filter $(TARGET),i686-apple-darwin x86_64-apple-darwin))
10-
# Do nothing on macOS.
11-
all:
12-
exit 0
13-
else
9+
1410
# check that the .stack_sizes section is generated
15-
# this test requires LLVM >= 6.0.0
16-
vers = $(shell $(RUSTC) -Vv)
17-
ifneq (,$(findstring LLVM version: 3,$(vers)))
18-
all:
19-
exit 0
20-
else ifneq (,$(findstring LLVM version: 4,$(vers)))
21-
all:
22-
exit 0
23-
else ifneq (,$(findstring LLVM version: 5,$(vers)))
24-
all:
25-
exit 0
26-
else
2711
all:
2812
$(RUSTC) -C opt-level=3 -Z emit-stack-sizes --emit=obj foo.rs
2913
size -A $(TMPDIR)/foo.o | $(CGREP) .stack_sizes
30-
endif
31-
endif
+3-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
-include ../tools.mk
22

3+
# ignore-windows
4+
# ignore-macos
5+
36
# Test for #39529.
47
# `-z text` causes ld to error if there are any non-PIC sections
58

6-
ifeq ($(UNAME),Darwin)
7-
all:
8-
else ifdef IS_WINDOWS
9-
all:
10-
else
119
all:
1210
$(RUSTC) hello.rs -C link-args=-Wl,-z,text
13-
endif
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
-include ../tools.mk
22

3-
# FIXME: ignore freebsd/windows
4-
# on windows `rustc --dep-info` produces Makefile dependency with
3+
# ignore-windows
4+
# ignore-freebsd
5+
# FIXME: on windows `rustc --dep-info` produces Makefile dependency with
56
# windows native paths (e.g. `c:\path\to\libfoo.a`)
67
# but msys make seems to fail to recognize such paths, so test fails.
7-
ifneq ($(shell uname),FreeBSD)
8-
ifndef IS_WINDOWS
8+
99
all:
1010
$(RUSTC) --emit dep-info main.rs
1111
$(CGREP) "input.txt" "input.bin" "input.md" < $(TMPDIR)/main.d
12-
else
13-
all:
14-
15-
endif
16-
17-
else
18-
all:
19-
20-
endif
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
-include ../tools.mk
22

3-
ifndef IS_WINDOWS
4-
# The assembly for exit-unreachable.rs should be shorter because it's missing
5-
# (at minimum) a return instruction.
3+
# ignore-windows
4+
#
5+
# Because of Windows exception handling, the code is not necessarily any shorter.
6+
# https://github.com/llvm-mirror/llvm/commit/64b2297786f7fd6f5fa24cdd4db0298fbf211466
67

78
all:
89
$(RUSTC) -O --emit asm exit-ret.rs
910
$(RUSTC) -O --emit asm exit-unreachable.rs
1011
test `wc -l < $(TMPDIR)/exit-unreachable.s` -lt `wc -l < $(TMPDIR)/exit-ret.s`
11-
else
12-
# Because of Windows exception handling, the code is not necessarily any shorter.
13-
# https://github.com/llvm-mirror/llvm/commit/64b2297786f7fd6f5fa24cdd4db0298fbf211466
14-
all:
15-
endif
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
-include ../tools.mk
22

3-
ifeq ($(UNAME),Linux)
3+
# only-linux
4+
45
all:
56
$(RUSTC) foo.rs
67
$(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -ldl -o $(TMPDIR)/foo
78
$(call RUN,foo)
89
$(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -ldl -pie -fPIC -o $(TMPDIR)/foo
910
$(call RUN,foo)
10-
else
11-
all:
12-
endif
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
-include ../tools.mk
22

3+
# ignore-windows
4+
35
OUT := $(TMPDIR)/out
46

5-
ifndef IS_WINDOWS
67
all: time
78

89
time: libc
@@ -13,6 +14,3 @@ time: libc
1314
libc:
1415
mkdir -p $(OUT)/libc
1516
$(RUSTC) in/libc/lib.rs --crate-name=libc -Cmetadata=foo -o $(OUT)/libc/liblibc.rlib
16-
else
17-
all:
18-
endif
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
-include ../tools.mk
22

3-
ifeq (musl,$(findstring musl,$(TARGET)))
4-
all: skip
5-
else
6-
all: test
7-
endif
3+
# ignore-musl
84

9-
test: foo
5+
all: foo
106
$(call RUN,foo)
117

12-
skip:
13-
echo "expected failure"
14-
158
foo: foo.rs $(call NATIVE_STATICLIB,foo)
169
$(RUSTC) $< -lfoo $(EXTRACXXFLAGS)
1710

1811
$(TMPDIR)/libfoo.o: foo.cpp
1912
$(call COMPILE_OBJ_CXX,$@,$<)
20-
21-
.PHONY: all test skip
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
-include ../tools.mk
22

3-
ifeq ($(findstring stage1,$(RUST_BUILD_STAGE)),stage1)
4-
# ignore stage1
5-
all:
3+
# ignore-stage1
64

7-
else
85
all:
96
$(RUSTC) a.rs && $(RUSTC) b.rs
107
$(BARE_RUSTC) c.rs -L dependency=$(TMPDIR) --extern b=$(TMPDIR)/libb.rlib \
118
--out-dir=$(TMPDIR)
12-
endif
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
-include ../tools.mk
22

3-
ifeq ($(findstring stage1,$(RUST_BUILD_STAGE)),stage1)
4-
# ignore stage1
5-
all:
3+
# ignore-stage1
64

7-
else
85
all:
96
$(RUSTC) a.rs && $(RUSTC) b.rs && $(RUSTC) c.rs
10-
endif
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
-include ../tools.mk
22

3-
ifdef IS_WINDOWS
4-
# Do nothing on MSVC.
5-
all:
6-
exit 0
7-
else
3+
# ignore-windows
4+
85
all:
96
$(RUSTC) --emit=obj app.rs
107
nm $(TMPDIR)/app.o | $(CGREP) rust_begin_unwind
118
nm $(TMPDIR)/app.o | $(CGREP) rust_eh_personality
129
nm $(TMPDIR)/app.o | $(CGREP) rust_oom
13-
endif
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
-include ../tools.mk
22

3-
ifeq ($(if $(IS_WINDOWS),$(IS_MSVC),no),)
3+
# only-mingw
44

55
all: empty.rs
66
cp -r $(shell cygpath -u $(shell $(RUSTC) --print sysroot)) $(TMPDIR)/sysroot
77
$(RUSTC) --target $(TARGET) --sysroot $(TMPDIR)/sysroot -L$(TMPDIR)/obj -Z print-link-args empty.rs | $(CGREP) 'lib\\crt2.o'
88
mkdir -p $(TMPDIR)/obj
99
mv $(TMPDIR)/sysroot/lib/rustlib/$(TARGET)/lib/crt2.o $(TMPDIR)/obj/crt2.o
1010
$(RUSTC) --target $(TARGET) --sysroot $(TMPDIR)/sysroot -L$(TMPDIR)/obj -Z print-link-args empty.rs | $(CGREP) 'obj\\crt2.o'
11-
12-
else
13-
14-
all:
15-
16-
endif
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
-include ../tools.mk
22

3-
ifdef IS_WINDOWS
4-
all:
5-
else
3+
# ignore-windows
64

75
NAME := $(shell $(RUSTC) --print file-names foo.rs)
86

@@ -11,4 +9,3 @@ all:
119
$(RUSTC) foo.rs -o $(TMPDIR)/outdir/$(NAME)
1210
ln -nsf outdir/$(NAME) $(TMPDIR)
1311
RUST_LOG=rustc_metadata::loader $(RUSTC) bar.rs
14-
endif

0 commit comments

Comments
 (0)