()
| 916 | |
| 917 | #[test] |
| 918 | fn test_with_reserved_temp_register_index() -> Result<()> { |
| 919 | let upcalls = HashMap::default(); |
| 920 | let mut global = GlobalSymtable::new(upcalls); |
| 921 | let mut local = global.enter_scope(); |
| 922 | local.put_local(SymbolKey::from("a"), SymbolPrototype::Scalar(ExprType::Integer))?; |
| 923 | local.put_local(SymbolKey::from("b"), SymbolPrototype::Scalar(ExprType::Integer))?; |
| 924 | |
| 925 | local.with_reserved_temp( |
| 926 | |e| e, |
| 927 | |reg, _| { |
| 928 | assert_eq!(Register::local(2).unwrap(), reg); |
| 929 | Ok(()) |
| 930 | }, |
| 931 | )?; |
| 932 | |
| 933 | Ok(()) |
| 934 | } |
| 935 | |
| 936 | #[test] |
| 937 | fn test_with_reserved_temp_shifts_temp_scope_base() -> Result<()> { |
nothing calls this directly
no test coverage detected