22mod lucetc_tests {
33 use failure:: Error ;
44 use lucet_module:: bindings:: Bindings ;
5+ use lucet_module:: Capabilities ;
56 use lucet_wasi_sdk:: * ;
67 use lucetc:: { Compiler , HeapSettings , OptLevel } ;
78 use std:: collections:: HashMap ;
@@ -39,7 +40,8 @@ mod lucetc_tests {
3940 let m = module_from_c ( & [ "empty" ] , & [ ] ) . expect ( "build module for empty" ) ;
4041 let b = Bindings :: empty ( ) ;
4142 let h = HeapSettings :: default ( ) ;
42- let c = Compiler :: new ( & m, OptLevel :: Fast , & b, h, false ) . expect ( "compile empty" ) ;
43+ let c = Compiler :: new ( & m, OptLevel :: Fast , & b, h, Capabilities :: default ( ) )
44+ . expect ( "compile empty" ) ;
4345 let mdata = c. module_data ( ) . unwrap ( ) ;
4446 assert ! ( mdata. heap_spec( ) . is_some( ) ) ;
4547 // clang creates 3 globals:
@@ -74,7 +76,8 @@ mod lucetc_tests {
7476 let m = module_from_c ( & [ "c" ] , & [ "c" ] ) . expect ( "build module for c" ) ;
7577 let b = Bindings :: empty ( ) ;
7678 let h = HeapSettings :: default ( ) ;
77- let c = Compiler :: new ( & m, OptLevel :: Fast , & b, h, false ) . expect ( "compile c" ) ;
79+ let c =
80+ Compiler :: new ( & m, OptLevel :: Fast , & b, h, Capabilities :: default ( ) ) . expect ( "compile c" ) ;
7881 let mdata = c. module_data ( ) . unwrap ( ) ;
7982 assert_eq ! ( mdata. import_functions( ) . len( ) , 0 , "import functions" ) ;
8083 assert_eq ! ( mdata. export_functions( ) . len( ) , 1 , "export functions" ) ;
@@ -91,7 +94,8 @@ mod lucetc_tests {
9194 let m = module_from_c ( & [ "d" ] , & [ "d" ] ) . expect ( "build module for d" ) ;
9295 let b = d_only_test_bindings ( ) ;
9396 let h = HeapSettings :: default ( ) ;
94- let c = Compiler :: new ( & m, OptLevel :: Fast , & b, h, false ) . expect ( "compile d" ) ;
97+ let c =
98+ Compiler :: new ( & m, OptLevel :: Fast , & b, h, Capabilities :: default ( ) ) . expect ( "compile d" ) ;
9599 let mdata = c. module_data ( ) . unwrap ( ) ;
96100 assert_eq ! ( mdata. import_functions( ) . len( ) , 1 , "import functions" ) ;
97101 assert_eq ! ( mdata. export_functions( ) . len( ) , 1 , "export functions" ) ;
@@ -107,7 +111,8 @@ mod lucetc_tests {
107111 let m = module_from_c ( & [ "c" , "d" ] , & [ "c" , "d" ] ) . expect ( "build module for c & d" ) ;
108112 let b = Bindings :: empty ( ) ;
109113 let h = HeapSettings :: default ( ) ;
110- let c = Compiler :: new ( & m, OptLevel :: Fast , & b, h, false ) . expect ( "compile c & d" ) ;
114+ let c = Compiler :: new ( & m, OptLevel :: Fast , & b, h, Capabilities :: default ( ) )
115+ . expect ( "compile c & d" ) ;
111116 let mdata = c. module_data ( ) . unwrap ( ) ;
112117 assert_eq ! ( mdata. import_functions( ) . len( ) , 0 , "import functions" ) ;
113118 assert_eq ! ( mdata. export_functions( ) . len( ) , 2 , "export functions" ) ;
0 commit comments