]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/output-type-permutations/Makefile
Rollup merge of #98301 - ortem:pretty-printers-nonzero, r=wesleywiser
[rust.git] / src / test / run-make-fulldeps / 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 $(call STATICLIB,bar)
8         rm -f $(TMPDIR)/{lib,}bar.{dll.exp,dll.lib,pdb,dll.a}
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         $(RUSTC) foo.rs --emit asm=$(TMPDIR)/foo
29         rm $(TMPDIR)/foo
30         $(RUSTC) foo.rs --emit=asm=$(TMPDIR)/foo
31         rm $(TMPDIR)/foo
32         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
33
34         $(RUSTC) foo.rs --emit llvm-bc -o $(TMPDIR)/foo
35         rm $(TMPDIR)/foo
36         $(RUSTC) foo.rs --emit llvm-bc=$(TMPDIR)/foo
37         rm $(TMPDIR)/foo
38         $(RUSTC) foo.rs --emit=llvm-bc=$(TMPDIR)/foo
39         rm $(TMPDIR)/foo
40         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
41
42         $(RUSTC) foo.rs --emit llvm-ir -o $(TMPDIR)/foo
43         rm $(TMPDIR)/foo
44         $(RUSTC) foo.rs --emit llvm-ir=$(TMPDIR)/foo
45         rm $(TMPDIR)/foo
46         $(RUSTC) foo.rs --emit=llvm-ir=$(TMPDIR)/foo
47         rm $(TMPDIR)/foo
48         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
49
50         $(RUSTC) foo.rs --emit obj -o $(TMPDIR)/foo
51         rm $(TMPDIR)/foo
52         $(RUSTC) foo.rs --emit obj=$(TMPDIR)/foo
53         rm $(TMPDIR)/foo
54         $(RUSTC) foo.rs --emit=obj=$(TMPDIR)/foo
55         rm $(TMPDIR)/foo
56         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
57
58         $(RUSTC) foo.rs --emit link -o $(TMPDIR)/$(call BIN,foo)
59         rm $(TMPDIR)/$(call BIN,foo)
60         $(RUSTC) foo.rs --emit link=$(TMPDIR)/$(call BIN,foo)
61         rm $(TMPDIR)/$(call BIN,foo)
62         $(RUSTC) foo.rs --emit=link=$(TMPDIR)/$(call BIN,foo)
63         rm $(TMPDIR)/$(call BIN,foo)
64         rm -f $(TMPDIR)/foo.pdb
65         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
66
67         $(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/foo
68         rm $(TMPDIR)/foo
69         $(RUSTC) foo.rs --crate-type=rlib --emit link=$(TMPDIR)/foo
70         rm $(TMPDIR)/foo
71         $(RUSTC) foo.rs --crate-type=rlib --emit=link=$(TMPDIR)/foo
72         rm $(TMPDIR)/foo
73         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
74
75         $(RUSTC) foo.rs --crate-type=dylib -o $(TMPDIR)/$(call BIN,foo)
76         rm $(TMPDIR)/$(call BIN,foo)
77         $(RUSTC) foo.rs --crate-type=dylib --emit link=$(TMPDIR)/$(call BIN,foo)
78         rm $(TMPDIR)/$(call BIN,foo)
79         $(RUSTC) foo.rs --crate-type=dylib --emit=link=$(TMPDIR)/$(call BIN,foo)
80         rm $(TMPDIR)/$(call BIN,foo)
81         rm -f $(TMPDIR)/{lib,}foo.{dll.exp,dll.lib,pdb,dll.a,exe.a}
82         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ] || (ls -1 $(TMPDIR) && exit 1)
83
84         $(RUSTC) foo.rs --crate-type=staticlib -o $(TMPDIR)/foo
85         rm $(TMPDIR)/foo
86         $(RUSTC) foo.rs --crate-type=staticlib --emit link=$(TMPDIR)/foo
87         rm $(TMPDIR)/foo
88         $(RUSTC) foo.rs --crate-type=staticlib --emit=link=$(TMPDIR)/foo
89         rm $(TMPDIR)/foo
90         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
91
92         $(RUSTC) foo.rs --crate-type=bin -o $(TMPDIR)/$(call BIN,foo)
93         rm $(TMPDIR)/$(call BIN,foo)
94         $(RUSTC) foo.rs --crate-type=bin --emit link=$(TMPDIR)/$(call BIN,foo)
95         rm $(TMPDIR)/$(call BIN,foo)
96         $(RUSTC) foo.rs --crate-type=bin --emit=link=$(TMPDIR)/$(call BIN,foo)
97         rm $(TMPDIR)/$(call BIN,foo)
98         rm -f $(TMPDIR)/foo.pdb
99         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
100
101         $(RUSTC) foo.rs --emit llvm-ir=$(TMPDIR)/ir \
102                         --emit link \
103                         --crate-type=rlib
104         rm $(TMPDIR)/ir
105         rm $(TMPDIR)/libbar.rlib
106         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
107
108         $(RUSTC) foo.rs --emit asm=$(TMPDIR)/asm \
109                         --emit llvm-ir=$(TMPDIR)/ir \
110                         --emit llvm-bc=$(TMPDIR)/bc \
111                         --emit obj=$(TMPDIR)/obj \
112                         --emit link=$(TMPDIR)/link \
113                         --crate-type=staticlib
114         rm $(TMPDIR)/asm
115         rm $(TMPDIR)/ir
116         rm $(TMPDIR)/bc
117         rm $(TMPDIR)/obj
118         rm $(TMPDIR)/link
119         $(RUSTC) foo.rs --emit=asm=$(TMPDIR)/asm \
120                         --emit llvm-ir=$(TMPDIR)/ir \
121                         --emit=llvm-bc=$(TMPDIR)/bc \
122                         --emit obj=$(TMPDIR)/obj \
123                         --emit=link=$(TMPDIR)/link \
124                         --crate-type=staticlib
125         rm $(TMPDIR)/asm
126         rm $(TMPDIR)/ir
127         rm $(TMPDIR)/bc
128         rm $(TMPDIR)/obj
129         rm $(TMPDIR)/link
130         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
131
132         $(RUSTC) foo.rs --emit=asm,llvm-ir,llvm-bc,obj,link --crate-type=staticlib
133         rm $(TMPDIR)/bar.ll
134         rm $(TMPDIR)/bar.s
135         rm $(TMPDIR)/bar.o
136         rm $(call STATICLIB,bar)
137         mv $(TMPDIR)/bar.bc $(TMPDIR)/foo.bc
138         # Don't check that the $(TMPDIR) is empty - we left `foo.bc` for later
139         # comparison.
140
141         $(RUSTC) foo.rs --emit=llvm-bc,link --crate-type=rlib
142         cmp $(TMPDIR)/foo.bc $(TMPDIR)/bar.bc
143         rm $(TMPDIR)/bar.bc
144         rm $(TMPDIR)/foo.bc
145         $(call REMOVE_RLIBS,bar)
146         [ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]