@@ -48,11 +48,15 @@ fn run_cfail_test(config: config, props: test_props, testfile: &Path) {
4848}
4949
5050fn 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) ;
5253
53- if procres. status != 0 { fatal_procres ( ~"compilation failed!", procres); }
54+ if procres. status != 0 { fatal_procres ( ~"compilation failed!", procres); }
5455
55- procres = exec_compiled_test(config, props, testfile);
56+ exec_compiled_test(config, props, testfile)
57+ } else {
58+ jit_test(config, props, testfile)
59+ };
5660
5761 // The value our Makefile configures valgrind to return on failure
5862 const valgrind_err: int = 100;
@@ -76,13 +80,19 @@ fn check_correct_failure_status(procres: procres) {
7680}
7781
7882fn 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); }
8087
81- if procres . status != 0 { fatal_procres ( ~"compilation failed! ", procres); }
88+ procres = exec_compiled_test(config, props, testfile);
8289
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);
8493
85- if procres.status != 0 { fatal_procres(~" test run failed!", procres); }
94+ if procres.status != 0 { fatal_procres(~" jit failed!", procres); }
95+ }
8696}
8797
8898fn run_pretty_test(config: config, props: test_props, testfile: &Path) {
@@ -295,10 +305,19 @@ type procres = {status: int, stdout: ~str, stderr: ~str, cmdline: ~str};
295305
296306fn compile_test ( config : config , props : test_props ,
297307 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 {
298317 let link_args = ~[ ~"-L ", aux_output_dir_name ( config, testfile) . to_str ( ) ] ;
299318 compose_and_run_compiler (
300319 config, props, testfile,
301- make_compile_args ( config, props, link_args,
320+ make_compile_args ( config, props, link_args + extra_args ,
302321 make_exe_name, testfile) ,
303322 None )
304323}
0 commit comments