@@ -48,11 +48,15 @@ fn run_cfail_test(config: config, props: test_props, testfile: &Path) {
48
48
}
49
49
50
50
fn run_rfail_test( config : config , props : test_props , testfile : & Path ) {
51
- let mut procres = compile_test ( config, props, testfile) ;
51
+ let procres = if !config. jit {
52
+ let procres = compile_test ( config, props, testfile) ;
52
53
53
- if procres. status != 0 { fatal_procres ( ~"compilation failed!", procres); }
54
+ if procres. status != 0 { fatal_procres ( ~"compilation failed!", procres); }
54
55
55
- procres = exec_compiled_test(config, props, testfile);
56
+ exec_compiled_test(config, props, testfile)
57
+ } else {
58
+ jit_test(config, props, testfile)
59
+ };
56
60
57
61
// The value our Makefile configures valgrind to return on failure
58
62
const valgrind_err: int = 100;
@@ -76,13 +80,19 @@ fn check_correct_failure_status(procres: procres) {
76
80
}
77
81
78
82
fn run_rpass_test( config : config , props : test_props , testfile : & Path ) {
79
- let mut procres = compile_test ( config, props, testfile) ;
83
+ if !config. jit {
84
+ let mut procres = compile_test ( config, props, testfile) ;
85
+
86
+ if procres. status != 0 { fatal_procres ( ~"compilation failed!", procres); }
80
87
81
- if procres . status != 0 { fatal_procres ( ~"compilation failed! ", procres); }
88
+ procres = exec_compiled_test(config, props, testfile);
82
89
83
- procres = exec_compiled_test(config, props, testfile);
90
+ if procres.status != 0 { fatal_procres(~" test run failed!", procres); }
91
+ } else {
92
+ let mut procres = jit_test(config, props, testfile);
84
93
85
- if procres.status != 0 { fatal_procres(~" test run failed!", procres); }
94
+ if procres.status != 0 { fatal_procres(~" jit failed!", procres); }
95
+ }
86
96
}
87
97
88
98
fn run_pretty_test(config: config, props: test_props, testfile: &Path) {
@@ -295,10 +305,19 @@ type procres = {status: int, stdout: ~str, stderr: ~str, cmdline: ~str};
295
305
296
306
fn compile_test ( config : config , props : test_props ,
297
307
testfile : & Path ) -> procres {
308
+ compile_test_ ( config, props, testfile, [ ] )
309
+ }
310
+
311
+ fn jit_test ( config : config , props : test_props , testfile : & Path ) -> procres {
312
+ compile_test_ ( config, props, testfile, [ ~"--jit"] )
313
+ }
314
+
315
+ fn compile_test_ ( config : config , props : test_props ,
316
+ testfile : & Path , extra_args : & [ ~str ] ) -> procres {
298
317
let link_args = ~[ ~"-L ", aux_output_dir_name ( config, testfile) . to_str ( ) ] ;
299
318
compose_and_run_compiler (
300
319
config, props, testfile,
301
- make_compile_args ( config, props, link_args,
320
+ make_compile_args ( config, props, link_args + extra_args ,
302
321
make_exe_name, testfile) ,
303
322
None )
304
323
}
0 commit comments