Skip to content

Commit 26eeff1

Browse files
committed
Convert compilation test to a run test
1 parent 40c4740 commit 26eeff1

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/raw.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,18 +268,36 @@ macro_rules! jit_entries {
268268
include!(concat!(env!("OUT_DIR"), "/entries.rs"));
269269

270270
#[test]
271-
#[should_panic]
272271
#[allow(unreachable_code)]
273272
#[allow(unused_variables)]
274-
fn demonstrate_compilation() {
273+
fn trivial_invocation() {
274+
trait MyDefault { fn default() -> Self; }
275+
276+
impl MyDefault for jit_word_t { fn default() -> Self { Default::default() } }
277+
278+
impl MyDefault for jit_float32_t { fn default() -> Self { Default::default() } }
279+
impl MyDefault for jit_float64_t { fn default() -> Self { Default::default() } }
280+
281+
#[cfg(target_pointer_width = "64")] /* avoid conflicting with jit_word_t */
282+
impl MyDefault for jit_int32_t { fn default() -> Self { Default::default() } }
283+
284+
impl MyDefault for jit_pointer_t { fn default() -> Self { crate::types::NULL } }
285+
275286
macro_rules! jit_entry {
287+
( $entry:ident( $enum_in:ident $(, $inarg:ident )* )
288+
=> $root:ident
289+
=> [ new_node $( , $suffix:ident )* ]
290+
=> $invokes:ident( $jit:ident $( , $outarg:ident )* )
291+
) => {
292+
/* skip */
293+
};
276294
( $entry:ident( $( $inarg:ident ),* )
277295
=> $root:ident
278296
=> [ $stem:ident $( , $suffix:ident )* ]
279297
=> $invokes:ident( $enum:ident $( , $outarg:ident )* )
280298
) => {
281299
{
282-
$( let $inarg = todo!(); )*
300+
$( let $inarg = MyDefault::default(); )*
283301
let _ = $crate::Jit::new().new_state().$entry( $( $inarg ),* );
284302
}
285303
};

0 commit comments

Comments
 (0)