| 690 | } |
| 691 | |
| 692 | fn make_test_table() -> CompiledFunctionsTable { |
| 693 | let mut builder = CompiledFunctionsTableBuilder::new(); |
| 694 | |
| 695 | builder |
| 696 | // ========= Dense ========= |
| 697 | .push_func(def_func_key(0, 0), func_loc(0..10), FilePos::new(111)) |
| 698 | .push_func(def_func_key(0, 1), func_loc(10..20), FilePos::new(222)) |
| 699 | .push_func(def_func_key(0, 2), func_loc(20..30), FilePos::none()) |
| 700 | // Gap in dense keys! |
| 701 | .push_func(def_func_key(0, 5), func_loc(30..40), FilePos::new(333)) |
| 702 | // ========= Sparse ========= |
| 703 | .push_func( |
| 704 | array_to_wasm_tramp_key(0, 1), |
| 705 | func_loc(100..110), |
| 706 | FilePos::none(), |
| 707 | ) |
| 708 | .push_func( |
| 709 | array_to_wasm_tramp_key(0, 2), |
| 710 | func_loc(110..120), |
| 711 | FilePos::none(), |
| 712 | ) |
| 713 | .push_func( |
| 714 | array_to_wasm_tramp_key(0, 5), |
| 715 | func_loc(120..130), |
| 716 | FilePos::none(), |
| 717 | ); |
| 718 | |
| 719 | builder.finish() |
| 720 | } |
| 721 | |
| 722 | #[test] |
| 723 | fn src_locs() { |