Skip to content

Commit

Permalink
Convert compilation test to a run test
Browse files Browse the repository at this point in the history
  • Loading branch information
kulp committed Jun 26, 2020
1 parent 88e7fc8 commit 95c59e7
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,18 +268,36 @@ macro_rules! jit_entries {
include!(concat!(env!("OUT_DIR"), "/entries.rs"));

#[test]
#[should_panic]
#[allow(unreachable_code)]
#[allow(unused_variables)]
fn demonstrate_compilation() {
fn trivial_invocation() {
trait MyDefault { fn default() -> Self; }

impl MyDefault for jit_word_t { fn default() -> Self { Default::default() } }

impl MyDefault for jit_float32_t { fn default() -> Self { Default::default() } }
impl MyDefault for jit_float64_t { fn default() -> Self { Default::default() } }

#[cfg(target_pointer_width = "64")] /* avoid conflicting with jit_word_t */
impl MyDefault for jit_int32_t { fn default() -> Self { Default::default() } }

impl MyDefault for jit_pointer_t { fn default() -> Self { crate::types::NULL } }

macro_rules! jit_entry {
( $entry:ident( $enum_in:ident $(, $inarg:ident )* )
=> $root:ident
=> [ new_node $( , $suffix:ident )* ]
=> $invokes:ident( $jit:ident $( , $outarg:ident )* )
) => {
/* skip */
};
( $entry:ident( $( $inarg:ident ),* )
=> $root:ident
=> [ $stem:ident $( , $suffix:ident )* ]
=> $invokes:ident( $enum:ident $( , $outarg:ident )* )
) => {
{
$( let $inarg = todo!(); )*
$( let $inarg = MyDefault::default(); )*
let _ = $crate::Jit::new().new_state().$entry( $( $inarg ),* );
}
};
Expand Down

0 comments on commit 95c59e7

Please sign in to comment.