MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / encode_globl_is_exported

Function encode_globl_is_exported

crates/asm-to-binary/src/assembler/mod.rs:440–450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

438 fn encode_forward_branch_resolves() {
439 let tokens = text_section_tokens_with_forward_branch();
440 let layout = compute_layout(&tokens).unwrap();
441 let output = encode(&tokens, &layout).unwrap();
442
443 assert_eq!(output.symbol_address("end").unwrap(), 12);
444 let text = output.text_bytes();
445 let word = u32::from_le_bytes(text[4..8].try_into().unwrap());
446 assert_eq!(word & 0x7F, 0x63, "wrong opcode for branch");
447 assert_eq!((word >> 12) & 0x7, 1, "wrong funct3, expected BNE");
448 }
449
450 #[test]
451 fn encode_backward_branch_resolves() {
452 let tokens = vec![
453 AsmToken::Section(SectionKind::Text),

Callers

nothing calls this directly

Calls 2

compute_layoutFunction · 0.85
encodeFunction · 0.85

Tested by

no test coverage detected