To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

test_instsel.rs 961 Bytes
Newer Older
1
2
3
4
5
6
7
extern crate mu;
extern crate log;
extern crate simple_logger;

use test_ir::test_ir::factorial;
use self::mu::compiler::*;

8
9
use std::sync::Arc;

10
11
12
13
#[test]
fn test_instsel_fac() {
    simple_logger::init_with_level(log::LogLevel::Trace).ok();
    
qinsoon's avatar
qinsoon committed
14
    let vm = Arc::new(factorial());
15
    
16
17
18
19
20
    let compiler = Compiler::new(CompilerPolicy::new(vec![
            Box::new(passes::DefUse::new()),
            Box::new(passes::TreeGen::new()),
            Box::new(passes::ControlFlowAnalysis::new()),
            Box::new(passes::TraceGen::new()),
21
            Box::new(backend::inst_sel::InstructionSelection::new())
qinsoon's avatar
qinsoon committed
22
    ]), vm.clone());
23
    
qinsoon's avatar
qinsoon committed
24
    let func_id = vm.id_of("fac");
qinsoon's avatar
qinsoon committed
25
    let funcs = vm.funcs().read().unwrap();
26
    let func = funcs.get(&func_id).unwrap().read().unwrap();
qinsoon's avatar
qinsoon committed
27
    let func_vers = vm.func_vers().read().unwrap();
qinsoon's avatar
qinsoon committed
28
    let mut func_ver = func_vers.get(&func.cur_ver.unwrap()).unwrap().write().unwrap();
29
    
qinsoon's avatar
qinsoon committed
30
    compiler.compile(&mut func_ver);
31
}