10 let test = Test::gnu();
20 .must_have("-ffunction-sections")
21 .must_have("-fdata-sections");
22 test.cmd(1).must_have(test.td.path().join("foo.o"));
26 fn gnu_opt_level_1() {
27 let test = Test::gnu();
35 .must_not_have("-O2");
39 fn gnu_opt_level_s() {
40 let test = Test::gnu();
51 .must_not_have("-Oz");
56 let test = Test::gnu();
61 test.cmd(0).must_have("-g");
66 for vendor in &["unknown-linux-gnu", "apple-darwin"] {
67 let target = format!("x86_64-{}", vendor);
68 let test = Test::gnu();
82 fn gnu_x86_64_no_pic() {
83 for vendor in &["unknown-linux-gnu", "apple-darwin"] {
84 let target = format!("x86_64-{}", vendor);
85 let test = Test::gnu();
93 test.cmd(0).must_not_have("-fPIC");
99 for vendor in &["unknown-linux-gnu", "apple-darwin"] {
100 let target = format!("i686-{}", vendor);
101 let test = Test::gnu();
106 .compile("libfoo.a");
109 .must_not_have("-fPIC")
116 for vendor in &["unknown-linux-gnu", "apple-darwin"] {
117 let target = format!("i686-{}", vendor);
118 let test = Test::gnu();
124 .compile("libfoo.a");
126 test.cmd(0).must_have("-fPIC");
131 fn gnu_set_stdlib() {
132 let test = Test::gnu();
134 .cpp_set_stdlib(Some("foo"))
136 .compile("libfoo.a");
138 test.cmd(0).must_not_have("-stdlib=foo");
143 let test = Test::gnu();
147 .compile("libfoo.a");
149 test.cmd(0).must_have("-I").must_have("foo/bar");
154 let test = Test::gnu();
156 .define("FOO", Some("bar"))
159 .compile("libfoo.a");
161 test.cmd(0).must_have("-DFOO=bar").must_have("-DBAR");
165 fn gnu_compile_assembly() {
166 let test = Test::gnu();
169 .compile("libfoo.a");
170 test.cmd(0).must_have("foo.S");
175 let test = Test::msvc();
178 .compile("libfoo.a");
183 .must_not_have("/Z7")
185 test.cmd(1).must_have(test.td.path().join("foo.o"));
189 fn msvc_opt_level_0() {
190 let test = Test::msvc();
194 .compile("libfoo.a");
196 test.cmd(0).must_not_have("/O2");
201 let test = Test::msvc();
205 .compile("libfoo.a");
206 test.cmd(0).must_have("/Z7");
211 let test = Test::msvc();
215 .compile("libfoo.a");
217 test.cmd(0).must_have("/I").must_have("foo/bar");
222 let test = Test::msvc();
224 .define("FOO", Some("bar"))
227 .compile("libfoo.a");
229 test.cmd(0).must_have("/DFOO=bar").must_have("/DBAR");