()
| 60 | #[test] |
| 61 | #[cfg(feature = "arm")] |
| 62 | fn thumb_short_data_mapping() { |
| 63 | // When a .2byte directive is used in Thumb code, the assembler emits |
| 64 | // $d/$t mapping symbols for a 2-byte data region. The disassembler must |
| 65 | // not read 4 bytes as a .word when the next mapping symbol limits the |
| 66 | // data region to 2 bytes. |
| 67 | let diff_config = diff::DiffObjConfig::default(); |
| 68 | let obj = obj::read::parse( |
| 69 | include_object!("data/arm/code_1_vblank.o"), |
| 70 | &diff_config, |
| 71 | diff::DiffSide::Base, |
| 72 | ) |
| 73 | .unwrap(); |
| 74 | let symbol_idx = obj.symbols.iter().position(|s| s.name == "VBlankDMA_Level1").unwrap(); |
| 75 | let diff = diff::code::no_diff_code(&obj, symbol_idx, &diff_config).unwrap(); |
| 76 | let output = common::display_diff(&obj, &diff, symbol_idx, &diff_config); |
| 77 | // .2byte data followed by Thumb code must not be merged into a 4-byte .word |
| 78 | assert!( |
| 79 | !output.contains(".word"), |
| 80 | "2-byte data regions should not be decoded as 4-byte .word values.\n\ |
| 81 | The disassembler must respect mapping symbol boundaries." |
| 82 | ); |
| 83 | } |
| 84 | |
| 85 | #[test] |
| 86 | #[cfg(feature = "arm")] |
nothing calls this directly
no test coverage detected