Skip to content

Commit c07d7f0

Browse files
Add test for BasicBlock::get_address
1 parent f828918 commit c07d7f0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/all/test_basic_block.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,15 @@ fn test_get_first_use() {
201201
assert_eq!(bb1.get_first_use().unwrap().get_user(), branch_inst);
202202
assert!(bb1.get_first_use().unwrap().get_next_use().is_none());
203203
}
204+
205+
#[test]
206+
fn test_get_address() {
207+
let context = Context::create();
208+
let module = context.create_module("my_mod");
209+
let void_type = context.void_type();
210+
let fn_type = void_type.fn_type(&[], false);
211+
let fn_val = module.add_function("my_fn", fn_type, None);
212+
let bb = context.append_basic_block(fn_val, "entry");
213+
214+
assert!(bb.get_address().is_some());
215+
}

0 commit comments

Comments
 (0)