diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/test/run-make-fulldeps/output-type-permutations | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/test/run-make-fulldeps/output-type-permutations/Makefile | 146 | ||||
-rw-r--r-- | src/test/run-make-fulldeps/output-type-permutations/foo.rs | 3 |
2 files changed, 149 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/output-type-permutations/Makefile b/src/test/run-make-fulldeps/output-type-permutations/Makefile new file mode 100644 index 000000000..b6e0cbaf5 --- /dev/null +++ b/src/test/run-make-fulldeps/output-type-permutations/Makefile @@ -0,0 +1,146 @@ +-include ../tools.mk + +all: + $(RUSTC) foo.rs --crate-type=rlib,dylib,staticlib + $(call REMOVE_RLIBS,bar) + $(call REMOVE_DYLIBS,bar) + rm $(call STATICLIB,bar) + rm -f $(TMPDIR)/{lib,}bar.{dll.exp,dll.lib,pdb,dll.a} + # Check that $(TMPDIR) is empty. + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --crate-type=bin + rm $(TMPDIR)/$(call BIN,bar) + rm -f $(TMPDIR)/bar.pdb + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --emit=asm,llvm-ir,llvm-bc,obj,link + rm $(TMPDIR)/bar.ll + rm $(TMPDIR)/bar.bc + rm $(TMPDIR)/bar.s + rm $(TMPDIR)/bar.o + rm $(TMPDIR)/$(call BIN,bar) + rm -f $(TMPDIR)/bar.pdb + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --emit asm -o $(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --emit asm=$(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --emit=asm=$(TMPDIR)/foo + rm $(TMPDIR)/foo + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --emit llvm-bc -o $(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --emit llvm-bc=$(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --emit=llvm-bc=$(TMPDIR)/foo + rm $(TMPDIR)/foo + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --emit llvm-ir -o $(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --emit llvm-ir=$(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --emit=llvm-ir=$(TMPDIR)/foo + rm $(TMPDIR)/foo + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --emit obj -o $(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --emit obj=$(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --emit=obj=$(TMPDIR)/foo + rm $(TMPDIR)/foo + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --emit link -o $(TMPDIR)/$(call BIN,foo) + rm $(TMPDIR)/$(call BIN,foo) + $(RUSTC) foo.rs --emit link=$(TMPDIR)/$(call BIN,foo) + rm $(TMPDIR)/$(call BIN,foo) + $(RUSTC) foo.rs --emit=link=$(TMPDIR)/$(call BIN,foo) + rm $(TMPDIR)/$(call BIN,foo) + rm -f $(TMPDIR)/foo.pdb + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --crate-type=rlib --emit link=$(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --crate-type=rlib --emit=link=$(TMPDIR)/foo + rm $(TMPDIR)/foo + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --crate-type=dylib -o $(TMPDIR)/$(call BIN,foo) + rm $(TMPDIR)/$(call BIN,foo) + $(RUSTC) foo.rs --crate-type=dylib --emit link=$(TMPDIR)/$(call BIN,foo) + rm $(TMPDIR)/$(call BIN,foo) + $(RUSTC) foo.rs --crate-type=dylib --emit=link=$(TMPDIR)/$(call BIN,foo) + rm $(TMPDIR)/$(call BIN,foo) + rm -f $(TMPDIR)/{lib,}foo.{dll.exp,dll.lib,pdb,dll.a,exe.a} + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] || (ls -1 $(TMPDIR) && exit 1) + + $(RUSTC) foo.rs --crate-type=staticlib -o $(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --crate-type=staticlib --emit link=$(TMPDIR)/foo + rm $(TMPDIR)/foo + $(RUSTC) foo.rs --crate-type=staticlib --emit=link=$(TMPDIR)/foo + rm $(TMPDIR)/foo + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --crate-type=bin -o $(TMPDIR)/$(call BIN,foo) + rm $(TMPDIR)/$(call BIN,foo) + $(RUSTC) foo.rs --crate-type=bin --emit link=$(TMPDIR)/$(call BIN,foo) + rm $(TMPDIR)/$(call BIN,foo) + $(RUSTC) foo.rs --crate-type=bin --emit=link=$(TMPDIR)/$(call BIN,foo) + rm $(TMPDIR)/$(call BIN,foo) + rm -f $(TMPDIR)/foo.pdb + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --emit llvm-ir=$(TMPDIR)/ir \ + --emit link \ + --crate-type=rlib + rm $(TMPDIR)/ir + rm $(TMPDIR)/libbar.rlib + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --emit asm=$(TMPDIR)/asm \ + --emit llvm-ir=$(TMPDIR)/ir \ + --emit llvm-bc=$(TMPDIR)/bc \ + --emit obj=$(TMPDIR)/obj \ + --emit link=$(TMPDIR)/link \ + --crate-type=staticlib + rm $(TMPDIR)/asm + rm $(TMPDIR)/ir + rm $(TMPDIR)/bc + rm $(TMPDIR)/obj + rm $(TMPDIR)/link + $(RUSTC) foo.rs --emit=asm=$(TMPDIR)/asm \ + --emit llvm-ir=$(TMPDIR)/ir \ + --emit=llvm-bc=$(TMPDIR)/bc \ + --emit obj=$(TMPDIR)/obj \ + --emit=link=$(TMPDIR)/link \ + --crate-type=staticlib + rm $(TMPDIR)/asm + rm $(TMPDIR)/ir + rm $(TMPDIR)/bc + rm $(TMPDIR)/obj + rm $(TMPDIR)/link + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] + + $(RUSTC) foo.rs --emit=asm,llvm-ir,llvm-bc,obj,link --crate-type=staticlib + rm $(TMPDIR)/bar.ll + rm $(TMPDIR)/bar.s + rm $(TMPDIR)/bar.o + rm $(call STATICLIB,bar) + mv $(TMPDIR)/bar.bc $(TMPDIR)/foo.bc + # Don't check that the $(TMPDIR) is empty - we left `foo.bc` for later + # comparison. + + $(RUSTC) foo.rs --emit=llvm-bc,link --crate-type=rlib + cmp $(TMPDIR)/foo.bc $(TMPDIR)/bar.bc + rm $(TMPDIR)/bar.bc + rm $(TMPDIR)/foo.bc + $(call REMOVE_RLIBS,bar) + [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] diff --git a/src/test/run-make-fulldeps/output-type-permutations/foo.rs b/src/test/run-make-fulldeps/output-type-permutations/foo.rs new file mode 100644 index 000000000..f0a2cc6ad --- /dev/null +++ b/src/test/run-make-fulldeps/output-type-permutations/foo.rs @@ -0,0 +1,3 @@ +#![crate_name = "bar"] + +fn main() {} |