@@ -414,15 +414,14 @@ mod test {
414
414
}
415
415
416
416
#[ test]
417
- #[ should_panic] // TODO test needs updating: We only mangle link_name, not name, and many here were inner functions.
418
417
fn test_multiargs_nats ( ) {
419
418
//pf1 contains pf2 contains mono_func -> pf1<a> and pf1<b> share pf2's and they share mono_func
420
419
421
420
let tv = |i| Type :: new_var_use ( i, TypeBound :: Copyable ) ;
422
421
let sv = |i| TypeArg :: new_var_use ( i, TypeParam :: max_nat ( ) ) ;
423
422
let sa = |n| TypeArg :: BoundedNat { n } ;
424
423
let n: u64 = 5 ;
425
- let mut outer = FunctionBuilder :: new (
424
+ let mut outer = FunctionBuilder :: new_pub (
426
425
"mainish" ,
427
426
Signature :: new (
428
427
ValueArray :: ty_parametric (
@@ -441,7 +440,7 @@ mod test {
441
440
442
441
let mono_func = {
443
442
let mut fb = mb
444
- . define_function ( "get_usz" , Signature :: new ( vec ! [ ] , usize_t ( ) ) )
443
+ . define_function_pub ( "get_usz" , Signature :: new ( vec ! [ ] , usize_t ( ) ) )
445
444
. unwrap ( ) ;
446
445
let cst0 = fb. add_load_value ( ConstUsize :: new ( 1 ) ) ;
447
446
fb. finish_with_outputs ( [ cst0] ) . unwrap ( )
@@ -452,7 +451,7 @@ mod test {
452
451
[ TypeParam :: max_nat ( ) , TypeBound :: Copyable . into ( ) ] ,
453
452
Signature :: new ( ValueArray :: ty_parametric ( sv ( 0 ) , tv ( 1 ) ) . unwrap ( ) , tv ( 1 ) ) ,
454
453
) ;
455
- let mut pf2 = mb. define_function ( "pf2" , pf2t) . unwrap ( ) ;
454
+ let mut pf2 = mb. define_function_pub ( "pf2" , pf2t) . unwrap ( ) ;
456
455
let [ inw] = pf2. input_wires_arr ( ) ;
457
456
let [ idx] = pf2. call ( mono_func. handle ( ) , & [ ] , [ ] ) . unwrap ( ) . outputs_arr ( ) ;
458
457
let op_def = collections:: value_array:: EXTENSION . get_op ( "get" ) . unwrap ( ) ;
@@ -472,7 +471,7 @@ mod test {
472
471
usize_t ( ) ,
473
472
) ,
474
473
) ;
475
- let mut pf1 = mb. define_function ( "pf1" , pf1t) . unwrap ( ) ;
474
+ let mut pf1 = mb. define_function_pub ( "pf1" , pf1t) . unwrap ( ) ;
476
475
477
476
// pf1: Two calls to pf2, one depending on pf1's TypeArg, the other not
478
477
let inner = pf1
@@ -570,7 +569,7 @@ mod test {
570
569
571
570
let _main = {
572
571
let mut builder = module_builder
573
- . define_function ( "main" , Signature :: new_endo ( Type :: UNIT ) )
572
+ . define_function_pub ( "main" , Signature :: new_endo ( Type :: UNIT ) )
574
573
. unwrap ( ) ;
575
574
let func_ptr = builder
576
575
. load_func ( foo. handle ( ) , & [ Type :: UNIT . into ( ) ] )
0 commit comments