]> git.lizzy.rs Git - rust.git/blob - src/test/run-make/output-type-permutations/Makefile
a785e916cf73379ba73d5c3a5756f9addb5b8aa7
[rust.git] / src / test / run-make / output-type-permutations / Makefile
1 -include ../tools.mk
2
3 all:
4         $(RUSTC) foo.rs --crate-type=rlib,dylib,staticlib
5         $(call REMOVE_RLIBS,bar)
6         $(call REMOVE_DYLIBS,bar)
7         rm $(TMPDIR)/libbar.a
8         rm -f $(TMPDIR)/bar.{exp,lib,pdb}
9         # Check that $(TMPDIR) is empty.
10         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
11
12         $(RUSTC) foo.rs --crate-type=bin
13         rm $(TMPDIR)/$(call BIN,bar)
14         rm -f $(TMPDIR)/bar.pdb
15         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
16
17         $(RUSTC) foo.rs --emit=asm,llvm-ir,llvm-bc,obj,link
18         rm $(TMPDIR)/bar.ll
19         rm $(TMPDIR)/bar.bc
20         rm $(TMPDIR)/bar.s
21         rm $(TMPDIR)/bar.o
22         rm $(TMPDIR)/$(call BIN,bar)
23         rm -f $(TMPDIR)/bar.pdb
24         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
25
26         $(RUSTC) foo.rs --emit=asm -o $(TMPDIR)/foo
27         rm $(TMPDIR)/foo
28         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
29
30         $(RUSTC) foo.rs --emit=llvm-bc -o $(TMPDIR)/foo
31         rm $(TMPDIR)/foo
32         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
33
34         $(RUSTC) foo.rs --emit=llvm-ir -o $(TMPDIR)/foo
35         rm $(TMPDIR)/foo
36         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
37
38         $(RUSTC) foo.rs --emit=obj -o $(TMPDIR)/foo
39         rm $(TMPDIR)/foo
40         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
41
42         $(RUSTC) foo.rs --emit=link -o $(TMPDIR)/$(call BIN,foo)
43         rm $(TMPDIR)/$(call BIN,foo)
44         rm -f $(TMPDIR)/foo.pdb
45         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
46
47         $(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/foo
48         rm $(TMPDIR)/foo
49         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
50
51         $(RUSTC) foo.rs --crate-type=dylib -o $(TMPDIR)/$(call BIN,foo)
52         rm $(TMPDIR)/$(call BIN,foo)
53         rm -f $(TMPDIR)/foo.{exp,lib,pdb}
54         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
55
56         $(RUSTC) foo.rs --crate-type=staticlib -o $(TMPDIR)/foo
57         rm $(TMPDIR)/foo
58         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
59
60         $(RUSTC) foo.rs --crate-type=bin -o $(TMPDIR)/$(call BIN,foo)
61         rm $(TMPDIR)/$(call BIN,foo)
62         rm -f $(TMPDIR)/foo.pdb
63         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
64
65         $(RUSTC) foo.rs --emit=asm,llvm-ir,llvm-bc,obj,link --crate-type=staticlib
66         rm $(TMPDIR)/bar.ll
67         rm $(TMPDIR)/bar.s
68         rm $(TMPDIR)/bar.o
69         rm $(TMPDIR)/libbar.a
70         mv $(TMPDIR)/bar.bc $(TMPDIR)/foo.bc
71         # Don't check that the $(TMPDIR) is empty - we left `foo.bc` for later
72         # comparison.
73
74         $(RUSTC) foo.rs --emit=llvm-bc,link --crate-type=rlib
75         cmp $(TMPDIR)/foo.bc $(TMPDIR)/bar.bc
76         rm $(TMPDIR)/bar.bc
77         rm $(TMPDIR)/foo.bc
78         $(call REMOVE_RLIBS,bar)
79         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]