@@ -26,24 +26,10 @@ impl TestCase {
26
26
27
27
const NO_SYSROOT_SUITE : & [ TestCase ] = & [
28
28
TestCase :: new ( "build.mini_core" , & |runner| {
29
- runner. run_rustc ( [
30
- "example/mini_core.rs" ,
31
- "--crate-name" ,
32
- "mini_core" ,
33
- "--crate-type" ,
34
- "lib,dylib" ,
35
- "--target" ,
36
- & runner. target_compiler . triple ,
37
- ] ) ;
29
+ runner. run_rustc ( [ "example/mini_core.rs" , "--crate-type" , "lib,dylib" ] ) ;
38
30
} ) ,
39
31
TestCase :: new ( "build.example" , & |runner| {
40
- runner. run_rustc ( [
41
- "example/example.rs" ,
42
- "--crate-type" ,
43
- "lib" ,
44
- "--target" ,
45
- & runner. target_compiler . triple ,
46
- ] ) ;
32
+ runner. run_rustc ( [ "example/example.rs" , "--crate-type" , "lib" ] ) ;
47
33
} ) ,
48
34
TestCase :: new ( "jit.mini_core_hello_world" , & |runner| {
49
35
let mut jit_cmd = runner. rustc_command ( [
@@ -53,8 +39,6 @@ const NO_SYSROOT_SUITE: &[TestCase] = &[
53
39
"example/mini_core_hello_world.rs" ,
54
40
"--cfg" ,
55
41
"jit" ,
56
- "--target" ,
57
- & runner. target_compiler . triple ,
58
42
] ) ;
59
43
jit_cmd. env ( "CG_CLIF_JIT_ARGS" , "abc bcd" ) ;
60
44
spawn_and_wait ( jit_cmd) ;
@@ -67,69 +51,30 @@ const NO_SYSROOT_SUITE: &[TestCase] = &[
67
51
"example/mini_core_hello_world.rs" ,
68
52
"--cfg" ,
69
53
"jit" ,
70
- "--target" ,
71
- & runner. target_compiler . triple ,
72
54
] ) ;
73
55
jit_cmd. env ( "CG_CLIF_JIT_ARGS" , "abc bcd" ) ;
74
56
spawn_and_wait ( jit_cmd) ;
75
57
} ) ,
76
58
TestCase :: new ( "aot.mini_core_hello_world" , & |runner| {
77
- runner. run_rustc ( [
78
- "example/mini_core_hello_world.rs" ,
79
- "--crate-name" ,
80
- "mini_core_hello_world" ,
81
- "--crate-type" ,
82
- "bin" ,
83
- "-g" ,
84
- "--target" ,
85
- & runner. target_compiler . triple ,
86
- ] ) ;
59
+ runner. run_rustc ( [ "example/mini_core_hello_world.rs" ] ) ;
87
60
runner. run_out_command ( "mini_core_hello_world" , [ "abc" , "bcd" ] ) ;
88
61
} ) ,
89
62
] ;
90
63
91
64
const BASE_SYSROOT_SUITE : & [ TestCase ] = & [
92
65
TestCase :: new ( "aot.arbitrary_self_types_pointers_and_wrappers" , & |runner| {
93
- runner. run_rustc ( [
94
- "example/arbitrary_self_types_pointers_and_wrappers.rs" ,
95
- "--crate-name" ,
96
- "arbitrary_self_types_pointers_and_wrappers" ,
97
- "--crate-type" ,
98
- "bin" ,
99
- "--target" ,
100
- & runner. target_compiler . triple ,
101
- ] ) ;
66
+ runner. run_rustc ( [ "example/arbitrary_self_types_pointers_and_wrappers.rs" ] ) ;
102
67
runner. run_out_command ( "arbitrary_self_types_pointers_and_wrappers" , [ ] ) ;
103
68
} ) ,
104
69
TestCase :: new ( "aot.issue_91827_extern_types" , & |runner| {
105
- runner. run_rustc ( [
106
- "example/issue-91827-extern-types.rs" ,
107
- "--crate-name" ,
108
- "issue_91827_extern_types" ,
109
- "--crate-type" ,
110
- "bin" ,
111
- "--target" ,
112
- & runner. target_compiler . triple ,
113
- ] ) ;
114
- runner. run_out_command ( "issue_91827_extern_types" , [ ] ) ;
70
+ runner. run_rustc ( [ "example/issue-91827-extern-types.rs" ] ) ;
71
+ runner. run_out_command ( "issue-91827-extern-types" , [ ] ) ;
115
72
} ) ,
116
73
TestCase :: new ( "build.alloc_system" , & |runner| {
117
- runner. run_rustc ( [
118
- "example/alloc_system.rs" ,
119
- "--crate-type" ,
120
- "lib" ,
121
- "--target" ,
122
- & runner. target_compiler . triple ,
123
- ] ) ;
74
+ runner. run_rustc ( [ "example/alloc_system.rs" , "--crate-type" , "lib" ] ) ;
124
75
} ) ,
125
76
TestCase :: new ( "aot.alloc_example" , & |runner| {
126
- runner. run_rustc ( [
127
- "example/alloc_example.rs" ,
128
- "--crate-type" ,
129
- "bin" ,
130
- "--target" ,
131
- & runner. target_compiler . triple ,
132
- ] ) ;
77
+ runner. run_rustc ( [ "example/alloc_example.rs" ] ) ;
133
78
runner. run_out_command ( "alloc_example" , [ ] ) ;
134
79
} ) ,
135
80
TestCase :: new ( "jit.std_example" , & |runner| {
@@ -138,8 +83,6 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
138
83
"-Cllvm-args=mode=jit" ,
139
84
"-Cprefer-dynamic" ,
140
85
"example/std_example.rs" ,
141
- "--target" ,
142
- & runner. target_compiler . triple ,
143
86
] ) ;
144
87
145
88
eprintln ! ( "[JIT-lazy] std_example" ) ;
@@ -148,83 +91,34 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
148
91
"-Cllvm-args=mode=jit-lazy" ,
149
92
"-Cprefer-dynamic" ,
150
93
"example/std_example.rs" ,
151
- "--target" ,
152
- & runner. target_compiler . triple ,
153
94
] ) ;
154
95
} ) ,
155
96
TestCase :: new ( "aot.std_example" , & |runner| {
156
- runner. run_rustc ( [
157
- "example/std_example.rs" ,
158
- "--crate-type" ,
159
- "bin" ,
160
- "--target" ,
161
- & runner. target_compiler . triple ,
162
- ] ) ;
97
+ runner. run_rustc ( [ "example/std_example.rs" ] ) ;
163
98
runner. run_out_command ( "std_example" , [ "arg" ] ) ;
164
99
} ) ,
165
100
TestCase :: new ( "aot.dst_field_align" , & |runner| {
166
- runner. run_rustc ( [
167
- "example/dst-field-align.rs" ,
168
- "--crate-name" ,
169
- "dst_field_align" ,
170
- "--crate-type" ,
171
- "bin" ,
172
- "--target" ,
173
- & runner. target_compiler . triple ,
174
- ] ) ;
175
- runner. run_out_command ( "dst_field_align" , [ ] ) ;
101
+ runner. run_rustc ( [ "example/dst-field-align.rs" ] ) ;
102
+ runner. run_out_command ( "dst-field-align" , [ ] ) ;
176
103
} ) ,
177
104
TestCase :: new ( "aot.subslice-patterns-const-eval" , & |runner| {
178
- runner. run_rustc ( [
179
- "example/subslice-patterns-const-eval.rs" ,
180
- "--crate-type" ,
181
- "bin" ,
182
- "-Cpanic=abort" ,
183
- "--target" ,
184
- & runner. target_compiler . triple ,
185
- ] ) ;
105
+ runner. run_rustc ( [ "example/subslice-patterns-const-eval.rs" ] ) ;
186
106
runner. run_out_command ( "subslice-patterns-const-eval" , [ ] ) ;
187
107
} ) ,
188
108
TestCase :: new ( "aot.track-caller-attribute" , & |runner| {
189
- runner. run_rustc ( [
190
- "example/track-caller-attribute.rs" ,
191
- "--crate-type" ,
192
- "bin" ,
193
- "-Cpanic=abort" ,
194
- "--target" ,
195
- & runner. target_compiler . triple ,
196
- ] ) ;
109
+ runner. run_rustc ( [ "example/track-caller-attribute.rs" ] ) ;
197
110
runner. run_out_command ( "track-caller-attribute" , [ ] ) ;
198
111
} ) ,
199
112
TestCase :: new ( "aot.float-minmax-pass" , & |runner| {
200
- runner. run_rustc ( [
201
- "example/float-minmax-pass.rs" ,
202
- "--crate-type" ,
203
- "bin" ,
204
- "-Cpanic=abort" ,
205
- "--target" ,
206
- & runner. target_compiler . triple ,
207
- ] ) ;
113
+ runner. run_rustc ( [ "example/float-minmax-pass.rs" ] ) ;
208
114
runner. run_out_command ( "float-minmax-pass" , [ ] ) ;
209
115
} ) ,
210
116
TestCase :: new ( "aot.mod_bench" , & |runner| {
211
- runner. run_rustc ( [
212
- "example/mod_bench.rs" ,
213
- "--crate-type" ,
214
- "bin" ,
215
- "--target" ,
216
- & runner. target_compiler . triple ,
217
- ] ) ;
117
+ runner. run_rustc ( [ "example/mod_bench.rs" ] ) ;
218
118
runner. run_out_command ( "mod_bench" , [ ] ) ;
219
119
} ) ,
220
120
TestCase :: new ( "aot.issue-72793" , & |runner| {
221
- runner. run_rustc ( [
222
- "example/issue-72793.rs" ,
223
- "--crate-type" ,
224
- "bin" ,
225
- "--target" ,
226
- & runner. target_compiler . triple ,
227
- ] ) ;
121
+ runner. run_rustc ( [ "example/issue-72793.rs" ] ) ;
228
122
runner. run_out_command ( "issue-72793" , [ ] ) ;
229
123
} ) ,
230
124
] ;
@@ -501,6 +395,9 @@ impl TestRunner {
501
395
cmd. arg ( "--out-dir" ) ;
502
396
cmd. arg ( format ! ( "{}" , BUILD_EXAMPLE_OUT_DIR . to_path( & self . dirs) . display( ) ) ) ;
503
397
cmd. arg ( "-Cdebuginfo=2" ) ;
398
+ cmd. arg ( "--target" ) ;
399
+ cmd. arg ( & self . target_compiler . triple ) ;
400
+ cmd. arg ( "-Cpanic=abort" ) ;
504
401
cmd. args ( args) ;
505
402
cmd
506
403
}
0 commit comments