Skip to content

Commit 40c4740

Browse files
committed
Demonstrate compilability of generated functions
1 parent 41ce4f2 commit 40c4740

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/raw.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,30 @@ macro_rules! jit_entries {
267267

268268
include!(concat!(env!("OUT_DIR"), "/entries.rs"));
269269

270+
#[test]
271+
#[should_panic]
272+
#[allow(unreachable_code)]
273+
#[allow(unused_variables)]
274+
fn demonstrate_compilation() {
275+
macro_rules! jit_entry {
276+
( $entry:ident( $( $inarg:ident ),* )
277+
=> $root:ident
278+
=> [ $stem:ident $( , $suffix:ident )* ]
279+
=> $invokes:ident( $enum:ident $( , $outarg:ident )* )
280+
) => {
281+
{
282+
$( let $inarg = todo!(); )*
283+
let _ = $crate::Jit::new().new_state().$entry( $( $inarg ),* );
284+
}
285+
};
286+
}
287+
288+
macro_rules! jit_entries {
289+
( $( $tokens:tt )* ) => {
290+
unsafe { $( $tokens )* }
291+
};
292+
}
293+
294+
include!{ concat!(env!("OUT_DIR"), "/entries.rs") }
295+
}
296+

0 commit comments

Comments
 (0)