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 1.52 KB
Newer Older
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
1
// Copyright 2017 The Australian National University
2
//
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
3
4
5
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
6
//
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
7
//     http://www.apache.org/licenses/LICENSE-2.0
8
//
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
9
10
11
12
13
14
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

15
16
17
18
extern crate mu;

use test_ir::test_ir::factorial;
use self::mu::compiler::*;
qinsoon's avatar
qinsoon committed
19
use self::mu::vm::VM;
20

21
22
use std::sync::Arc;

23
24
#[test]
fn test_instsel_fac() {
qinsoon's avatar
qinsoon committed
25
    VM::start_logging_trace();
26

qinsoon's avatar
qinsoon committed
27
    let vm = Arc::new(factorial());
28
29
30

    let compiler = Compiler::new(
        CompilerPolicy::new(vec![
31
32
33
34
            Box::new(passes::DefUse::new()),
            Box::new(passes::TreeGen::new()),
            Box::new(passes::ControlFlowAnalysis::new()),
            Box::new(passes::TraceGen::new()),
35
36
            Box::new(backend::inst_sel::InstructionSelection::new()),
        ]),
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
37
        &vm,
38
39
    );

qinsoon's avatar
qinsoon committed
40
    let func_id = vm.id_of("fac");
qinsoon's avatar
qinsoon committed
41
    let funcs = vm.funcs().read().unwrap();
42
    let func = funcs.get(&func_id).unwrap().read().unwrap();
qinsoon's avatar
qinsoon committed
43
    let func_vers = vm.func_vers().read().unwrap();
44
45
46
47
48
49
    let mut func_ver = func_vers
        .get(&func.cur_ver.unwrap())
        .unwrap()
        .write()
        .unwrap();

qinsoon's avatar
qinsoon committed
50
    compiler.compile(&mut func_ver);
51
}